/**
 * ESTILOS PARA ÁREA DE DISTRIBUIDORES
 * LearningHub
 * Diseño profesional, corporativo y responsivo
 */

/* ========================================
   RESET Y BASE
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Colores corporativos LearningHub */
    --brand-primary: #1565c0;
    --brand-primary-dark: #0d47a1;
    --brand-primary-light: #4f93df;
    --brand-secondary: #51c65b;
    --brand-accent: #4f3c7e;
    
    /* Colores del sistema */
    --color-success: #4caf50;
    --color-warning: #ff9800;
    --color-error: #f44336;
    --color-info: #2196f3;
    
    /* Grises */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    
    /* Texto */
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-disabled: #bdbdbd;
    
    /* Fondos */
    --bg-page: #f5f7fa;
    --bg-card: #ffffff;
    --bg-hover: #f8f9fa;
    
    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.04);
    
    /* Bordes */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    
    /* Transiciones */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   PÁGINA DE LOGIN
   ======================================== */
.login-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #1565c0 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.login-header {
    padding: 2rem 1rem;
    text-align: center;
}

.login-header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.logo-link {
    display: inline-block;
}

.logo {
    height: 70px;
    width: auto;
    transition: transform var(--transition-base);
}

.logo:hover {
    transform: scale(1.05);
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    gap: 2rem;
}

.login-box {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-box-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Alertas */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.alert-error {
    background: #fee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* Formulario */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.label-icon {
    width: 18px;
    height: 18px;
    color: var(--brand-primary);
}

.form-input {
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition-fast);
    background: var(--bg-card);
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eye-icon {
    width: 22px;
    height: 22px;
    color: var(--gray-500);
    transition: color var(--transition-fast);
}

.password-toggle:hover .eye-icon {
    color: var(--brand-primary);
}

.error-message {
    display: none;
    color: var(--color-error);
    font-size: 0.85rem;
}

.error-message.visible {
    display: block;
}

.form-group-checkbox {
    display: flex;
    align-items: center;
    margin: 0.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--brand-primary);
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(21, 101, 192, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--text-primary);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn-icon-right {
    width: 18px;
    height: 18px;
}

.login-box-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.help-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.link {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.link:hover {
    color: var(--brand-primary-dark);
    text-decoration: underline;
}

.login-info {
    text-align: center;
    color: #ffffff;
    max-width: 440px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.login-info p {
    margin-bottom: 0.75rem;
}

.login-info p:last-child {
    margin-bottom: 0;
}

.login-footer {
    padding: 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

/* ========================================
   PÁGINA DE DASHBOARD
   ======================================== */
.dashboard-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-page);
}

.dashboard-header {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-left .logo {
    height: 50px;
}

.dashboard-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #ffffff;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
}

.user-icon {
    width: 24px;
    height: 24px;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.btn-logout .icon {
    width: 20px;
    height: 20px;
}

/* Main content */
.dashboard-main {
    flex: 1;
    padding: 2rem 1rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.welcome-section {
    margin-bottom: 2.5rem;
    text-align: center;
}

.welcome-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.welcome-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Info cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.info-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    transition: all var(--transition-base);
    border: 1px solid var(--gray-200);
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.card-icon svg {
    width: 32px;
    height: 32px;
    color: #ffffff;
}

.card-icon-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
}

.card-icon-success {
    background: linear-gradient(135deg, var(--brand-secondary), #43a047);
}

.card-icon-warning {
    background: linear-gradient(135deg, var(--color-warning), #f57c00);
}

.card-icon-info {
    background: linear-gradient(135deg, var(--color-info), #1976d2);
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.card-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

.card-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card-list li {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.card-list a {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 600;
}

.card-list a:hover {
    text-decoration: underline;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Download list styles */
.download-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.download-list li {
    margin: 0;
}

.download-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-hover);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-normal);
}

.download-link:hover {
    background: var(--brand-primary-light);
    color: #ffffff;
    border-color: var(--brand-primary);
    transform: translateX(4px);
}

.download-icon {
    flex-shrink: 0;
    color: var(--brand-primary);
    transition: color var(--transition-fast);
}

.download-link:hover .download-icon {
    color: #ffffff;
}

.download-filename {
    flex: 1;
    font-weight: 500;
    word-break: break-word;
}

.download-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.download-link:hover .download-meta {
    color: rgba(255, 255, 255, 0.9);
}

/* Features section */
.features-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    border: 1px solid var(--gray-200);
}

.features-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
}

.feature-icon {
    width: 48px;
    height: 48px;
    color: var(--brand-primary);
    margin: 0 auto 1rem;
}

.feature-item h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Footer */
.dashboard-footer {
    background: var(--gray-900);
    color: #ffffff;
    padding: 2rem 1rem;
    text-align: center;
    margin-top: auto;
}

.dashboard-footer p {
    margin: 0.5rem 0;
}

.footer-links {
    font-size: 0.9rem;
}

.footer-links a {
    color: #ffffff;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--brand-secondary);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .site-title {
        font-size: 1.5rem;
    }
    
    .login-box {
        padding: 2rem 1.5rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header-left {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .dashboard-title {
        font-size: 1.25rem;
    }
    
    .user-name {
        display: none;
    }
    
    .btn-logout span {
        display: none;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo {
        height: 50px;
    }
    
    .site-title {
        font-size: 1.25rem;
    }
    
    .login-box {
        padding: 1.5rem 1rem;
    }
    
    .login-box-header h2 {
        font-size: 1.5rem;
    }
}
