/* Estilos generales */
/* Importar fuente Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fira+Mono&display=swap');

:root {
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --secondary: #2ec4b6;
  --success: #38b2ac;
  --danger: #e63946;
  --dark: #1f2937;
  --light: #f8fafc;
  --gray: #718096;
  --gray-light: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --border-radius: 12px;
}

body { 
    font-family: var(--font-family); 
    background: #f0f4f8; 
    padding: 0; 
    margin: 0; 
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

.container { 
    max-width: 800px; 
    margin: 2rem auto; 
    background: white; 
    padding: 2rem; 
    border-radius: var(--border-radius); 
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08),
                0 5px 10px -5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 { 
    color: var(--dark); 
    margin-bottom: 1.5rem; 
    font-size: 2rem;
    text-align: center;
    font-weight: 700;
}

/* Estilos de la vista previa de imágenes */
#preview { 
    display: flex; 
    flex-wrap: wrap; 
    margin: 1.5rem 0; 
    justify-content: center;
    gap: 12px;
    min-height: 80px;
}

.img-container {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    animation: imgFadeIn 0.3s ease-out;
}

@keyframes imgFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.img-container:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

#preview img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover;
}

.delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.img-container:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    transform: scale(1.15);
    background: #d32f2f;
}

/* Estilos de botones */
button {
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 0.8rem 1.5rem;
    font-size: 1rem; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: all 0.3s;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(67, 97, 238, 0.15);
    position: relative;
    overflow: hidden;
}

button:hover { 
    background: var(--primary-dark); 
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(67, 97, 238, 0.2);
}

button:active {
    transform: translateY(0);
}

button:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

#processBtn { 
    background: var(--secondary); 
    margin-left: 10px;
    box-shadow: 0 4px 6px rgba(46, 196, 182, 0.15);
}

#processBtn:hover {
    background: #25a89c;
    box-shadow: 0 7px 14px rgba(46, 196, 182, 0.2);
}

/* Indicador de carga */
#loading {
    display: none; 
    margin-top: 2rem;
    text-align: center;
}

.loader {
    border: 4px solid rgba(67, 97, 238, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
    box-shadow: 0 0 10px rgba(67, 97, 238, 0.15);
}

#loading p {
    color: var(--gray);
    font-weight: 500;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Botones de acción */
.action-buttons { 
    display: flex; 
    margin: 1.5rem 0; 
    gap: 12px;
}

.clear-btn { 
    background: var(--danger); 
    box-shadow: 0 4px 6px rgba(230, 57, 70, 0.15);
}

.clear-btn:hover {
    background: #c82333;
    box-shadow: 0 7px 14px rgba(230, 57, 70, 0.2);
}

#imageCounter {
    margin-top: 1rem;
    font-weight: 500;
    color: var(--gray);
    text-align: center;
}

.camera-icon, .trash-icon {
    margin-right: 10px;
    font-size: 20px;
}

/* Estado vacío */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    padding: 2rem;
    border: 2px dashed var(--gray-light);
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    background-color: rgba(247, 250, 252, 0.8);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 1rem;
}

.empty-state-text {
    text-align: center;
    font-weight: 500;
    color: var(--gray);
}

/* Selector de IA - Solo Gemini */
.ai-selector {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    background: white;
    border: 1px solid var(--gray-light);
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.ai-option {
    display: none;
}

.ai-label {
    flex: 1;
    padding: 1.25rem 2rem;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.ai-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: rgba(67, 97, 238, 0.04);
    transition: height 0.3s ease;
}

.ai-label:hover::before {
    height: 100%;
}

.ai-option:checked + .ai-label {
    background: rgba(67, 97, 238, 0.05);
    color: var(--primary);
}

.ai-option:checked + .ai-label .ai-icon svg {
    transform: scale(1.1);
}

.ai-option:disabled + .ai-label {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.ai-icon svg {
    width: 100%;
    height: 100%;
    transition: transform 0.2s ease;
}

/* Estilo específico para Gemini cuando está seleccionado */
#gemini:checked + .ai-label {
    background: rgba(66, 133, 244, 0.05);
    color: #4285F4;
}

/* Tablas de resultados */
.result-tables {
    margin-top: 2rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius);
    overflow: hidden;
    font-size: 0.95rem;
}

.table-title {
    color: var(--dark);
    font-size: 1.25rem;
    margin: 1.5rem 0 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 1rem;
}

.table-title:before {
    content: '';
    position: absolute;
    left: 0;
    height: 1.25rem;
    width: 4px;
    background: var(--primary);
    border-radius: 4px;
}

.data-table th {
    background: var(--primary);
    color: white;
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-light);
    color: var(--dark);
    transition: all 0.2s;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: #f8fafc;
}

.data-table .numeric {
    text-align: right;
    font-family: 'Inter', 'Monaco', monospace;
    font-size: 0.95rem;
    font-weight: 500;
}

.totals-table {
    margin-left: auto;
    width: auto;
    min-width: 300px;
}

.totals-row {
    font-weight: 700;
}

.totals-row td {
    color: var(--primary);
    font-size: 1.05rem;
    border-top: 2px solid var(--primary);
}

.data-table .totals-label {
    color: var(--dark);
    font-weight: 500;
}

.table-empty {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
    font-style: italic;
}

.table-container {
    position: relative;
    margin-bottom: 2rem;
}

/* Pestañas para navegación */
.result-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--gray-light);
    gap: 1rem;
}

.tab {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    color: var(--gray);
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab:hover {
    color: var(--primary-dark);
}

.tab-icon {
    margin-right: 8px;
    font-size: 1.1rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

/* Información de cabecera */
.cabecera-info {
    background: #f9fafc;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    border: 1px solid var(--gray-light);
}

.info-item {
    min-width: 200px;
    flex: 1;
}

.info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray);
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    font-weight: 600;
}

.info-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark);
}

/* Resumen de costos */
.cost-summary {
    margin: 2rem 0;
}

.cost-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-light);
}

.cost-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-light);
}

.cost-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
}

.cost-title svg {
    margin-right: 10px;
    color: var(--primary);
}

.cost-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--dark);
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid var(--gray-light);
}

.cost-details {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.cost-metric {
    flex: 1;
    min-width: 200px;
}

.metric-label {
    color: var(--gray);
    font-size: 0.85rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.metric-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
}

.metric-value .value-number {
    margin-right: 5px;
}

.token-bar {
    margin-top: 1.5rem;
    height: 8px;
    width: 100%;
    background: var(--gray-light);
    border-radius: 4px;
    overflow: hidden;
}

.token-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #738DF9);
    border-radius: 4px;
}

.tokens-info {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.8rem;
    color: var(--gray);
}

.optimization-stats {
    background: rgba(46, 196, 182, 0.08);
    border-left: 4px solid var(--secondary);
    padding: 1rem 1.25rem;
    margin-top: 1.5rem;
    border-radius: 8px;
    color: #0d9488;
    font-size: 0.95rem;
}

.optimization-stats strong {
    color: #065f46;
}

/* Modo de añadir más fotos */
.add-more-mode {
    background: rgba(67, 97, 238, 0.05);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    border-left: 4px solid var(--primary);
}

.add-more-mode .icon {
    font-size: 28px;
    margin-right: 1.25rem;
    color: var(--primary);
}

.add-more-mode .text {
    flex: 1;
}

.add-more-mode .title {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.add-more-mode .description {
    color: var(--dark);
    font-size: 0.9rem;
}

.images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 1rem 0;
}

.previous-image {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.previous-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.previous-image .badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.previous-count {
    background: var(--gray-light);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--dark);
    margin-left: 10px;
    font-weight: 500;
}

/* Información de optimización */
.optimization-info {
    background: rgba(67, 97, 238, 0.05);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin: 1.5rem 0;
    color: var(--primary-dark);
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.optimization-info svg {
    margin-right: 12px;
    flex-shrink: 0;
    margin-top: 3px;
}

.features-list {
    margin-top: 0.5rem;
    padding-left: 1.25rem;
}

.features-list li {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

/* Retroalimentación y mensajes de error */
.feedback-box {
    margin-top: 1.5rem;
    background: rgba(67, 97, 238, 0.05);
    border-left: 4px solid var(--primary);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.feedback-box h3 {
    margin-top: 0;
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.error-box {
    background: rgba(230, 57, 70, 0.05);
    border-left: 4px solid var(--danger);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.error-message {
    margin-bottom: 1rem;
    color: var(--danger);
    font-weight: 600;
}

.details {
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 8px;
    font-family: 'Fira Mono', monospace;
    overflow-x: auto;
    font-size: 14px;
    margin-top: 1.5rem;
    border: 1px solid var(--gray-light);
}

/* Botones de acción adicionales */
.back-btn { 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 1rem 1.5rem; 
    font-size: 1rem; 
    border-radius: 8px; 
    cursor: pointer; 
    text-decoration: none; 
    display: inline-block; 
    margin-top: 1.5rem; 
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(67, 97, 238, 0.15);
}

.back-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(67, 97, 238, 0.2);
}

.feedback-btn {
    display: inline-block;
    background: var(--success);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(46, 196, 182, 0.15);
}

.feedback-btn:hover {
    background: #2bb19f;
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(46, 196, 182, 0.2);
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        margin: 1rem auto;
        width: 90%;
        max-width: 600px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    button {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .ai-label {
        padding: 1rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .ai-icon {
        width: 28px;
        height: 28px;
    }
    
    .data-table th, 
    .data-table td {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .table-title {
        font-size: 1.15rem;
    }
    
    .tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .cost-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .add-more-mode {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .add-more-mode .icon {
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .process-btn {
        margin-left: 0 !important;
    }
    
    #processBtn {
        margin-left: 0;
    }
    
    .action-buttons button {
        width: 100%;
        margin: 0 0 0.75rem 0;
    }
    
    .ai-selector {
        margin: 1rem 0;
    }
    
    .counter-badge {
        width: 100%;
        box-sizing: border-box;
    }
    
    .preview-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.25rem;
        width: 92%;
        margin: 0.75rem auto;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .img-container {
        width: 90px;
        height: 90px;
    }
    
    .ai-selector {
        flex-wrap: wrap;
    }
    
    .ai-label {
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--gray-light);
    }
    
    .ai-label:last-child {
        border-bottom: none;
    }
    
    .cabecera-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .info-item {
        min-width: 100%;
    }
    
    .result-tabs {
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .tab {
        white-space: nowrap;
        font-size: 0.85rem;
        padding: 0.75rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
        margin-top: -0.75rem;
    }
    
    .features-list {
        padding-left: 1rem;
    }
    
    .optimization-info {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .main-footer {
        padding: 1rem 0;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Añadidos para nuevos elementos */
.subtitle {
    text-align: center;
    color: var(--gray);
    margin-top: -1rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.preview-container {
    min-height: 120px;
    background-color: rgba(247, 250, 252, 0.5);
    border-radius: var(--border-radius);
    border: 2px dashed var(--gray-light);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    transition: all 0.3s ease;
}

.preview-container:hover {
    border-color: var(--primary);
    background-color: rgba(67, 97, 238, 0.02);
}

.counter-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: rgba(67, 97, 238, 0.08);
    color: var(--primary);
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0.5rem auto 1.5rem;
    text-align: center;
    width: fit-content;
}

.upload-btn {
    background: var(--primary);
}

.process-btn {
    width: 100%;
    margin-top: 1rem;
    background: var(--secondary);
    box-shadow: 0 4px 6px rgba(46, 196, 182, 0.2);
}

.process-btn svg {
    margin-right: 8px;
}

.reset-link {
    display: inline-flex;
    align-items: center;
    color: var(--danger);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.reset-link svg {
    display: inline-block;
    vertical-align: -3px;
    margin-right: 5px;
}

.reset-link:hover {
    color: #c53030;
}

/* Mejoras adicionales */
header {
    margin-bottom: 2rem;
}

/* Mejoras responsivas */
@media (max-width: 480px) {
    .preview-container {
        padding: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
        margin: 0 0 0.75rem 0;
    }
    
    #processBtn {
        margin-left: 0;
    }
}

/* Estilos para el footer */
.main-footer {
    text-align: center;
    padding: 1.5rem 0;
    color: var(--gray);
    margin-top: 2rem;
    font-size: 0.9rem;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.version {
    background-color: rgba(67, 97, 238, 0.08);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

.copyright {
    font-weight: 500;
}

/* Ajustes para estilos de alerta */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-danger {
    background-color: rgba(230, 57, 70, 0.05);
    border-color: var(--danger);
    color: var(--danger);
}

.alert-info {
    background-color: rgba(67, 97, 238, 0.05);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.alert h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.alert pre {
    margin: 0.5rem 0 0;
    padding: 0.75rem;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Fira Mono', monospace;
    font-size: 0.9rem;
}

/* Fix para formulario en móvil */
#facturaForm {
    width: 100%;
}

/* Mejor manejo de espacio para el contenedor principal en móvil */
@media (max-width: 480px) {
    .container {
        margin: 0.5rem auto;
        padding: 1rem;
        width: 94%;
    }
    
    .subtitle {
        font-size: 0.95rem;
        margin-top: -0.75rem;
    }
    
    .features-list {
        padding-left: 1rem;
    }
    
    .optimization-info {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .main-footer {
        padding: 1rem 0;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Mejora para la presentación del footer en pantallas pequeñas */
@media (max-width: 380px) {
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Micro-interacciones */
input[type="radio"] + label {
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="radio"]:checked + label {
    transform: translateY(-2px);
}

/* Mejor separación visual entre secciones */
section, .section {
    margin-bottom: 2.5rem;
}

/* Estilos para el módulo de documentos */

/* 1. Overlay del Modal (manejado principalmente por Tailwind) */
#modal-editar {
  /* Tailwind ya hace: hidden fixed inset-0 bg-black bg-opacity-40 flex items-center justify-center z-50 */
  padding: 20px; /* Espacio entre el borde de la pantalla y el modal blanco */
  box-sizing: border-box; /* Para que el padding no aumente el tamaño total */
}

/* 2. Contenedor Blanco del Modal (el que debe tener TODO el scroll) */
#modal-editar .bg-white {
  background: #fff; 
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  max-width: 600px; 
  width: 100%;     
  max-height: calc(100vh - 40px) !important; /* Altura máxima considerando el padding de #modal-editar */
  overflow-y: auto !important;             /* Scroll vertical SI el contenido se desborda */
  box-sizing: border-box !important; /* Asegurar que padding/border no expandan */
}

/* Media query para ajustar padding en móviles */
@media (max-width: 700px) {
  #modal-editar {
    padding: 10px; /* Menos padding en móviles */
  }
  #modal-editar .bg-white {
    max-height: calc(100vh - 20px) !important; /* Ajustar altura máxima para padding reducido */
  }
}

/* Estilos de la tabla de búsqueda (fuera del modal) */
#tabla-documentos table { border-collapse: collapse; width: 100%; }
#tabla-documentos th, #tabla-documentos td { border: 1px solid #e2e8f0; padding: 8px; }
#tabla-documentos th { background: #f7fafc; font-weight: 600; }
#tabla-documentos tr:nth-child(even) { background: #f8fafc; }

/* Estilos de los botones de acción en la tabla de búsqueda */
button.editar, button.eliminar { transition: background 0.2s; }
/* Los estilos de hover para los iconos SVG ya están inline en el script.js */ 