/* ========================================
   ESTILOS PRINCIPALES - PROYECTO WEB
   ======================================== */

/* ========== IMPORTAR ESTILOS BASE ========== */
@import url('./base/reset.css');
@import url('./base/variables.css');
@import url('./base/typography.css');

/* ========== IMPORTAR COMPONENTES ========== */
@import url('./components/buttons.css');
@import url('./components/cards.css');
@import url('./components/forms.css');
@import url('./components/navigation.css');

/* ========== IMPORTAR LAYOUTS ========== */
@import url('./layouts/header.css');
@import url('./layouts/main.css');
@import url('./layouts/footer.css');

/* ========== IMPORTAR UTILIDADES ========== */
@import url('./utilities/accessibility.css');
@import url('./utilities/responsive.css');
@import url('./utilities/helpers.css');

/* ========== ESTILOS GLOBALES ADICIONALES ========== */

/* Body global */
body {
    margin: 0;
    padding: 1rem;
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: var(--line-height-base);
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Contenedor global */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Enlaces globales */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover,
a:focus {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Listas globales */
ul, ol {
    margin: 0 0 var(--spacing-md) 0;
    padding-left: var(--spacing-lg);
}

li {
    margin-bottom: var(--spacing-xs);
}

/* Imágenes globales */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Tablas globales */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-md);
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: var(--gray-100);
    font-weight: 600;
}

/* ========== ESTILOS PARA IMPRESIÓN ========== */
@media print {
    body {
        padding: 0;
        background: white;
        color: black;
    }
    
    .no-print {
        display: none;
    }
    
    .topbar,
    .theme-toggle,
    .actions {
        display: none;
    }
}

/* ========== ESTILOS PARA RTL (Right-to-Left) ========== */
.rtl {
    direction: rtl;
    text-align: right;
}

.rtl .text-left {
    text-align: right;
}

.rtl .text-right {
    text-align: left;
}

.rtl .ml-1 { margin-left: 0; margin-right: var(--spacing-xs); }
.rtl .ml-2 { margin-left: 0; margin-right: var(--spacing-sm); }
.rtl .ml-3 { margin-left: 0; margin-right: var(--spacing-md); }
.rtl .ml-4 { margin-left: 0; margin-right: var(--spacing-lg); }
.rtl .ml-5 { margin-left: 0; margin-right: var(--spacing-xl); }

.rtl .mr-1 { margin-right: 0; margin-left: var(--spacing-xs); }
.rtl .mr-2 { margin-right: 0; margin-left: var(--spacing-sm); }
.rtl .mr-3 { margin-right: 0; margin-left: var(--spacing-md); }
.rtl .mr-4 { margin-right: 0; margin-left: var(--spacing-lg); }
.rtl .mr-5 { margin-right: 0; margin-left: var(--spacing-xl); }

/* ========== ESTILOS ADICIONALES PARA PÁGINAS ESPECÍFICAS ========== */

/* Página de inicio */
.home-page {
    text-align: center;
    padding: 2rem;
}

/* Página de error */
.error-page {
    text-align: center;
    padding: 4rem 1rem;
}

.error-page h1 {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
}

.error-page p {
    font-size: var(--font-size-lg);
    color: var(--muted);
}

/* Spinner de carga */
.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary);
    border-radius: var(--border-radius-full);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: var(--z-index-modal);
}

[data-theme="dark"] .loading-overlay {
    background: rgba(0, 0, 0, 0.8);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border);
    margin: var(--spacing-lg) 0;
}

/* Icon wrapper */
.icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--border-radius-md);
}

/* ========== ESTILOS PARA ESTADO DE CARGA ========== */

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-300) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--border-radius-md);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== ESTILOS PARA NOTIFICACIONES ========== */

.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    background: white;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-index-modal);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--danger);
}

.notification.warning {
    border-left: 4px solid var(--warning);
}

/* ========== ESTILOS PARA MODALES ========== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-index-modal);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========== ESTILOS PARA TOOLTIPS ========== */

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background: var(--gray-800);
    color: white;
    text-align: center;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-sm);
    position: absolute;
    z-index: var(--z-index-dropdown);
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
    font-size: var(--font-size-sm);
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--gray-800) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ========== ESTILOS PARA ICONOS ========== */

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    margin: 0 0.2em;
}

/* ========== ESTILOS PARA QR ========== */

.qr {
    margin: 10px 0;
}

.qr img {
    width: 120px;
    height: 120px;
}

/* ========== ESTILOS PARA PHRASES ========== */

.phrases {
    list-style: none;
    margin: 1rem 0;
    padding: 0;
}

.phrases li {
    background: #f0f8ff;
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-left: 3px solid var(--primary);
    text-align: left;
}

/* ========== ESTILOS PARA DISABILITY ICONS ========== */

.disability-icons {
    margin: 0.5rem 0;
    font-size: 1.5rem;
}

/* ========== ESTILOS PARA DISABILITY OPTIONS ========== */

.disability-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin: 0.5rem 0 1.5rem;
}

/* Fin del archivo main.css */