/* Custom Styles for PortaGal Calculator */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1f1f2e;
    color: #e0e0e0;
    height: 100vh;
}

/* Admin Panel Dark Theme */
.navbar-dark {
    background-color: #242438 !important;
}
.nav-link, .navbar-brand {
    color: #c8c8e8 !important;
}
.nav-link:hover, .navbar-brand:hover {
    color: #f0f0ff !important;
}

.admin-tabs {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
    justify-content: center;
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    background: #f8f9fa;
    border-radius: 2.2rem;
    box-shadow: 0 2px 16px rgba(79,91,213,0.07);
    padding: 1.2rem 2rem;
}
.tab-button {
    flex: 1 1 0;
    min-width: 200px;
    max-width: 320px;
    background: linear-gradient(90deg, #4f5bd5 0%, #5e5e8a 100%);
    color: #fff;
    border: 2px solid #4f5bd5;
    padding: 1.2rem 0;
    border-radius: 1.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.18rem;
    font-weight: 600;
    margin: 0 0.3rem;
    box-shadow: 0 2px 8px rgba(79,91,213,0.08);
    transition: background 0.3s, border 0.3s, color 0.3s, box-shadow 0.3s;
    outline: none;
}
.tab-button:hover, .tab-button:focus {
    background: linear-gradient(90deg, #5e5e8a 0%, #4f5bd5 100%);
    border-color: #5e5e8a;
    color: #fff;
    box-shadow: 0 4px 16px rgba(79,91,213,0.15);
}
.tab-button.active {
    background: #fff;
    color: #4f5bd5;
    border: 2px solid #4f5bd5;
    box-shadow: 0 4px 16px rgba(79,91,213,0.18);
    z-index: 2;
}
.tab-button.active::after {
    content: ' (Actual)';
    color: #4f5bd5;
    font-size: 0.9em;
    font-weight: 400;
    margin-left: 0.5em;
}

.admin-card {
    background: #242438;
    border: 1px solid #3b3b58;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: transform 0.3s, box-shadow 0.3s;
}
.admin-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.admin-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #ffffff;
}
.admin-card .card-actions button {
    background: transparent;
    border: none;
    color: #c8c8e8;
    cursor: pointer;
    font-size: 1.1rem;
    margin-left: 0.5rem;
}
.admin-card .card-actions button:hover {
    color: #f0f0ff;
}

/* Step Progress */
.step-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    right: -50%;
    width: 100%;
    height: 2px;
    background-color: #dee2e6;
    z-index: 1;
}

.step.active:not(:last-child)::after,
.step.completed:not(:last-child)::after {
    background-color: #0d6efd;
}

.step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #dee2e6;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.step.active .step-circle {
    background-color: #0d6efd;
    color: white;
}

.step.completed .step-circle {
    background-color: #198754;
    color: white;
}

.step span {
    font-size: 12px;
    text-align: center;
    color: #6c757d;
    font-weight: 500;
}

.step.active span {
    color: #0d6efd;
    font-weight: 600;
}

/* Refuerzo visual al seleccionar: capa suave sobre la imagen dentro de la tarjeta */
.option-card.selected .option-card__preview-img,
.option-card.selected .option-card__gallery-img {
    opacity: 0.85;
    filter: saturate(1.05);
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.step.completed span {
    color: #198754;
}

/* Step Content */
.step-content {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 500px;
}

.step-content.active {
    display: block;
}

.step-content h2 {
    color: #343a40;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.step-content h4 {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Option Cards */
.option-card {
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    text-align: center;
    position: relative;
}

.option-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.1);
}

.option-card.selected {
    border-color: #0d6efd;
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    box-shadow: 0 6px 18px rgba(13, 110, 253, 0.35);
    transform: translateY(-2px);
}

.option-card .option-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #6c757d;
}

.option-card.selected .option-icon {
    color: #0d6efd;
}

.option-card h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #343a40;
}

.option-card p {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0;
}

.option-card .price {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #0d6efd;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Accessory Checkboxes */
.accessory-option {
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    background: white;
}

.accessory-option:hover {
    border-color: #0d6efd;
}

.accessory-option.selected {
    border-color: #198754;
    background-color: #f8fff8;
}

.accessory-option input[type="checkbox"] {
    transform: scale(1.2);
    margin-right: 0.75rem;
}

/* Quote Summary */
.quote-summary {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 1.5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

.summary-item:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 1.1rem;
    color: #198754;
}

.summary-item .label {
    color: #6c757d;
}

.summary-item .value {
    font-weight: 600;
    color: #343a40;
}

/* Admin Styles */
.admin-nav {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.admin-nav .nav-link {
    color: #6c757d;
    font-weight: 500;
    padding: 1rem 1.5rem;
    border-radius: 10px 10px 0 0;
    transition: all 0.3s ease;
}

.admin-nav .nav-link.active {
    background-color: #0d6efd;
    color: white;
}

.admin-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 2rem;
    min-height: 600px;
}

/* Table Styles */
.table-custom {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table-custom thead {
    background: #f8f9fa;
}

.table-custom th {
    border: none;
    font-weight: 600;
    color: #495057;
    padding: 1rem;
}

.table-custom td {
    border: none;
    padding: 1rem;
    vertical-align: middle;
}

.table-custom tbody tr:hover {
    background-color: #f8f9fa;
}

/* Button Styles */
.btn-custom {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.btn-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Form Styles */
.form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .step-progress {
        flex-direction: column;
        gap: 1rem;
    }
    
    .step:not(:last-child)::after {
        display: none;
    }
    
    .step-content {
        padding: 1rem;
    }
    
    .option-card {
        margin-bottom: 0.5rem;
    }
    
    .quote-summary {
        margin-top: 2rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Alerts */
.alert-custom {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.5rem;
}

.alert-success-custom {
    background-color: #d1f2eb;
    color: #0c5460;
}

.alert-danger-custom {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-info-custom {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Admin Tabs Styled as Radio Buttons */
.admin-tabs {
    display: inline-flex;
    border: 1px solid #5a67d8;
    border-radius: 0.375rem;
    overflow: hidden;
    margin-bottom: 1rem;
}
.admin-tabs .tab-button {
    background: transparent;
    border: none;
    margin: 0;
    padding: 0.5rem 1rem;
    color: #3182ce;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.admin-tabs .tab-button:not(:last-child) {
    border-right: 1px solid #5a67d8;
}
.admin-tabs .tab-button.active {
    background: #5a67d8;
    color: #fff;
}
.admin-tabs .tab-button:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px #434190;
}

/* Estilos para los inputs de dimensiones */
.dimension-input {
    font-size: 1.1rem !important;
    padding: 10px 12px !important;
    border: 2px solid var(--portagal-primary-light) !important;
    border-radius: 6px !important;
    background-color: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    transition: all 0.2s ease-in-out !important;
}

.dimension-input:focus {
    border-color: var(--portagal-primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2) !important;
    outline: none !important;
}

/* Estilos para los inputs de cantidad y metros lineales */
.quantity-input,
.linear-input {
    transition: all 0.2s ease-in-out !important;
}

.quantity-input:focus,
.linear-input:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2) !important;
}

/* Estilos para la configuración de metros lineales */
.linear-meter-config {
    position: relative;
    overflow: hidden;
}

.linear-meter-config::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: #10b981;
}

/* Estilos para la configuración de cantidad */
.quantity-config {
    position: relative;
    overflow: hidden;
}

.quantity-config::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: #0ea5e9;
}

/* Mejoras para visualización móvil */
@media (max-width: 768px) {
    .dimensions-section {
        padding: 1rem !important;
    }
    
    .dimension-input {
        font-size: 1rem !important;
        padding: 8px 10px !important;
    }
    
    .quantity-config,
    .linear-meter-config {
        padding: 10px !important;
    }
}

/* ===== ESTILOS PARA ELEMENTOS RECOMENDADOS ===== */

/* Elemento recomendado en el formulario */
.selection-card.recommended {
    position: relative;
    border: 3px solid #f59e0b !important;
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%) !important;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.25) !important;
    transform: translateY(-2px);
    animation: recommendedPulse 2s ease-in-out infinite;
}

/* Borde brillante solo cuando es recomendado pero aún no está seleccionado.
   Cuando está seleccionado, dejamos que el ::before de .option-card.selected
   muestre el icono de check redondo sin ser tapado por este fondo. */
.selection-card.recommended:not(.selected)::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #f59e0b, #fbbf24, #f59e0b);
    border-radius: inherit;
    z-index: -1;
    animation: borderGlow 3s ease-in-out infinite;
}

/* Badge de recomendado */
.recommended-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: badgeBounce 2s ease-in-out infinite;
}

.recommended-badge::before {
    content: '⭐';
    font-size: 0.8rem;
    animation: starSpin 3s linear infinite;
}

/* Texto destacado para elementos recomendados */
.selection-card.recommended .card-title {
    color: #92400e !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(146, 64, 14, 0.1);
}

.selection-card.recommended .card-description {
    color: #a16207 !important;
    font-weight: 500 !important;
}

.selection-card.recommended .card-price {
    color: #92400e !important;
    font-weight: 800 !important;
    font-size: 1.1em !important;
}

/* Hover effect mejorado para elementos recomendados */
.selection-card.recommended:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 35px rgba(245, 158, 11, 0.35) !important;
    border-color: #d97706 !important;
}

/* Animaciones */
@keyframes recommendedPulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(245, 158, 11, 0.25);
    }
    50% {
        box-shadow: 0 12px 35px rgba(245, 158, 11, 0.4);
    }
}

@keyframes borderGlow {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

@keyframes badgeBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

@keyframes starSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Tooltip para elementos recomendados */
.recommended-tooltip {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 20;
}

.recommended-tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid #1f2937;
}

.selection-card.recommended:hover .recommended-tooltip {
    opacity: 1;
}

/* Responsive para elementos recomendados */
@media (max-width: 768px) {
    .recommended-badge {
        top: -6px;
        right: -6px;
        padding: 3px 8px;
        font-size: 0.65rem;
    }
    
    .selection-card.recommended {
        transform: none;
    }
    
    .selection-card.recommended:hover {
        transform: translateY(-2px);
    }
}

/* Efecto especial para el primer elemento recomendado */
.selection-card.recommended.first-recommended {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fef3c7 100%) !important;
    border-color: #d97706 !important;
}

.selection-card.recommended.first-recommended .recommended-badge {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    animation: firstRecommendedPulse 1.5s ease-in-out infinite;
}

/* Estado combinado: recomendado + seleccionado.
   Aumentamos contraste sin perder el badge ni el check. */
.selection-card.recommended.selected {
    border-width: 3px;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.45), 0 0 0 2px rgba(13, 110, 253, 0.35);
}

@keyframes firstRecommendedPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
    }
}