/* ================================================
   SISTEMA CRUD DE CEPAS - ESTILOS ADMINISTRATIVOS
   ================================================ */

.admin-cepas-page {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    min-height: 100vh;
    padding: 40px 0;
}

.admin-header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.admin-header h1 {
    color: #3f111c;
    font-weight: 700;
}

.admin-header .lead {
    color: #6c757d;
    font-size: 1.1rem;
}

/* Botones principales */
.btn-wine {
    background: linear-gradient(135deg, #3f111c 0%, #5a1a2a 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(63, 17, 28, 0.3);
}

.btn-wine:hover {
    background: linear-gradient(135deg, #5a1a2a 0%, #3f111c 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(63, 17, 28, 0.4);
}

.btn-outline-wine {
    color: #3f111c;
    border: 2px solid #3f111c;
    background: transparent;
    transition: all 0.3s ease;
}

.btn-outline-wine:hover {
    background: #3f111c;
    color: white;
}

/* Filtros */
.filtros-cepas {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.filtros-cepas .form-select,
.filtros-cepas .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.filtros-cepas .form-select:focus,
.filtros-cepas .form-control:focus {
    border-color: #3f111c;
    box-shadow: 0 0 0 0.2rem rgba(63, 17, 28, 0.15);
}

/* Grid de cepas */
.cepas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

/* Tarjetas de cepa */
.cepa-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.cepa-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #3f111c;
}

.cepa-card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 20px;
    border-bottom: 3px solid #3f111c;
}

.cepa-card-title {
    color: #3f111c;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.cepa-card-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cepa-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Badges para tintas */
.cepa-badge.tipo-tinta,
.cepa-badge.tipo-tintas-estructuradas,
.cepa-badge.tipo-tintas-cuerpo-medio,
.cepa-badge.tipo-tintas-ligeras,
.cepa-badge.tipo-tintas-frescas {
    background: linear-gradient(135deg, #3f111c 0%, #6b0000 100%);
    color: white;
}

/* Diferenciación sutil por subcategoría de tintas */
.cepa-badge.tipo-tintas-estructuradas {
    background: linear-gradient(135deg, #2d0a13 0%, #4a0000 100%);
}

.cepa-badge.tipo-tintas-cuerpo-medio {
    background: linear-gradient(135deg, #3f111c 0%, #6b0000 100%);
}

.cepa-badge.tipo-tintas-ligeras {
    background: linear-gradient(135deg, #5a1a2a 0%, #8b1a2a 100%);
}

.cepa-badge.tipo-tintas-frescas {
    background: linear-gradient(135deg, #722F37 0%, #a13d4a 100%);
}

/* Badges para blancas */
.cepa-badge.tipo-blanca,
.cepa-badge.tipo-blancas-estructuradas,
.cepa-badge.tipo-blancas-cuerpo-medio,
.cepa-badge.tipo-blancas-ligeras {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #8B4513;
}

/* Diferenciación sutil por subcategoría de blancas */
.cepa-badge.tipo-blancas-estructuradas {
    background: linear-gradient(135deg, #d4af37 0%, #f0e68c 100%);
    color: #654321;
}

.cepa-badge.tipo-blancas-cuerpo-medio {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #8B4513;
}

.cepa-badge.tipo-blancas-ligeras {
    background: linear-gradient(135deg, #fff8dc 0%, #fffacd 100%);
    color: #8B6914;
}

/* Badge para rosadas */
.cepa-badge.tipo-rosada {
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
    color: white;
}

.cepa-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Estilos de imagen removidos - las imágenes solo aparecen en páginas individuales de cepa */

.cepa-card-description {
    color: #666;
    line-height: 1.7;
    margin-bottom: 15px;
    max-height: 100px;
    overflow: hidden;
    position: relative;
    font-size: 0.9rem;
}

.cepa-card-description::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, transparent, white);
}

.cepa-card-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.cepa-spec-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #3f111c;
    transition: all 0.3s ease;
}

.cepa-spec-item:hover {
    background: #3f111c;
    color: white;
}

.cepa-spec-label {
    font-weight: 600;
    color: #555;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.cepa-spec-item:hover .cepa-spec-label {
    color: rgba(255,255,255,0.8);
}

.cepa-spec-value {
    color: #3f111c;
    font-weight: 700;
    font-size: 0.9rem;
}

.cepa-spec-item:hover .cepa-spec-value {
    color: white;
}

.cepa-card-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
    margin-top: auto;
}

.cepa-card-actions .btn {
    flex: 1;
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cepa-card-actions .btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
}

.cepa-card-actions .btn-danger:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}

/* Modal */
.modal-header.bg-wine {
    background: linear-gradient(135deg, #3f111c 0%, #5a1a2a 100%) !important;
}

.modal-xl {
    max-width: 1140px;
}

.modal-body {
    padding: 30px;
}

.modal-body h6 {
    color: #3f111c;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3f111c;
}

.modal-body .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.modal-body .form-label.required::after {
    content: " *";
    color: #dc3545;
}

.modal-body .form-control,
.modal-body .form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: #3f111c;
    box-shadow: 0 0 0 0.2rem rgba(63, 17, 28, 0.15);
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid #e9ecef;
}

/* Botones con icono + para agregar taxonomías */
.input-group .btn-outline-secondary {
    border: 2px solid #e9ecef;
    color: #3f111c;
    transition: all 0.3s ease;
}

.input-group .btn-outline-secondary:hover {
    background: #3f111c;
    border-color: #3f111c;
    color: white;
    transform: scale(1.05);
}

.input-group .btn-outline-secondary i {
    font-size: 0.9rem;
}

/* Modal de nueva taxonomía */
#modalNuevaTaxonomia .modal-dialog {
    max-width: 500px;
}

#modalNuevaTaxonomia .alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: none;
    border-left: 4px solid #0c5460;
    border-radius: 8px;
    padding: 15px;
}

#modalNuevaTaxonomia .alert-info strong {
    color: #0c5460;
}

#tipo_taxonomia_texto {
    color: #155724;
    font-weight: 600;
}

/* Preview de imagen */
#preview-imagen-cepa {
    margin-top: 15px;
}

#preview-imagen-cepa img {
    max-width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

/* Loading spinner */
.spinner-border.text-wine {
    color: #3f111c !important;
    width: 3rem;
    height: 3rem;
}

/* Estados vacíos */
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    .cepas-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-header h1 {
        font-size: 1.8rem;
    }
    
    .cepa-card-actions {
        flex-direction: column;
    }
    
    .cepa-card-specs {
        grid-template-columns: 1fr;
    }
    
    .modal-xl {
        max-width: 95%;
    }
    
    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .admin-cepas-page {
        padding: 20px 0;
    }
    
    .admin-header {
        padding: 20px;
    }
    
    .admin-header h1 {
        font-size: 1.5rem;
    }
    
    .btn-wine {
        width: 100%;
        margin-top: 15px;
    }
    
    .cepa-card-title {
        font-size: 1.2rem;
    }
    
    .cepa-card-image {
        height: 180px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cepa-card {
    animation: fadeIn 0.5s ease forwards;
}

/* Utilidades */
.text-wine {
    color: #3f111c !important;
}

.bg-wine-light {
    background: #f8f5f9 !important;
}

.border-wine {
    border-color: #3f111c !important;
}
