/* ===================== ESTILOS GLOBALES - SISTEMA DE ESPEJOS ===================== */
/* VERSIÓN DESKTOP FIRST - Optimizado para laptops y PCs */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --background-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 25px 50px rgba(0,0,0,0.15);
    --card-radius: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background-gradient);
    min-height: 100vh;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

/* ===================== LAYOUT PRINCIPAL ===================== */

.container {
    width: 100%;
    max-width: 1200px;
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    min-height: 80vh;
}

/* ===================== PANTALLAS DE AUTENTICACIÓN ===================== */

.auth-container {
    display: flex;
    min-height: 80vh;
}

.auth-left {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.1"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
}

.auth-right {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo {
    font-size: 4em;
    margin-bottom: 20px;
    display: block;
}

.auth-title {
    font-size: 2.2em;
    font-weight: 300;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.auth-subtitle {
    color: #7f8c8d;
    font-size: 1.1em;
}

/* ===================== COMPONENTES DE FORMULARIO ===================== */

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-field {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    background: white;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.input-field.error {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* ===================== BOTONES MEJORADOS ===================== */

.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    font-family: inherit;
}

.btn:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
}

.btn-lg {
    padding: 18px 35px;
    font-size: 18px;
}

.btn-success {
    background: var(--success-color);
}

.btn-success:hover {
    background: #219653;
}

.btn-info {
    background: var(--info-color);
}

.btn-info:hover {
    background: #138496;
}

/* ===================== COMPONENTES ESPECÍFICOS ===================== */

.password-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    color: #7f8c8d;
    padding: 5px;
}

.password-requirements {
    font-size: 0.85em;
    color: #7f8c8d;
    margin-top: 8px;
    line-height: 1.4;
}

.info-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid var(--accent-color);
}

.info-card.success {
    background: #d4edda;
    border-left-color: var(--success-color);
    color: #155724;
}

.info-card.warning {
    background: #fff3cd;
    border-left-color: var(--warning-color);
    color: #856404;
}

/* ===================== TARJETAS Y LAYOUT ===================== */

.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    padding: 40px;
    border: 1px solid #f1f3f4;
}

.welcome-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.welcome-title {
    font-size: 3em;
    font-weight: 300;
    margin-bottom: 20px;
    color: white;
}

.welcome-subtitle {
    font-size: 1.3em;
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 30px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
}

.feature-title {
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: 600;
}

.feature-description {
    opacity: 0.8;
    line-height: 1.5;
}

/* ===================== SELECTOR DE ACCESO ===================== */

.access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.access-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.access-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    border-color: var(--accent-color);
}

.access-icon {
    font-size: 4em;
    margin-bottom: 20px;
    display: block;
}

.access-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-weight: 600;
}

.access-description {
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 20px;
}

.access-badge {
    display: inline-block;
    padding: 5px 15px;
    background: var(--accent-color);
    color: white;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

/* ===================== MENSAJES Y ALERTAS ===================== */

.alert {
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid transparent;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.hidden {
    display: none;
}

/* ===================== ENLACES ===================== */

.auth-links {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
}

.auth-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.auth-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ===================== ANIMACIONES ===================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

/* ===================== RESPONSIVE - MÓVIL ===================== */

@media (max-width: 768px) {
    body {
        padding: 20px;
        align-items: flex-start;
    }
    
    .container {
        min-height: auto;
        border-radius: 15px;
    }
    
    .auth-container {
        flex-direction: column;
        min-height: auto;
    }
    
    .auth-left {
        padding: 40px 20px;
        text-align: center;
    }
    
    .auth-right {
        padding: 40px 25px;
    }
    
    .auth-logo {
        font-size: 3em;
    }
    
    .auth-title {
        font-size: 1.8em;
    }
    
    .welcome-title {
        font-size: 2.2em;
    }
    
    .card {
        padding: 25px;
    }
    
    .access-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .btn-lg {
        padding: 15px 25px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .auth-left,
    .auth-right {
        padding: 30px 15px;
    }
    
    .card {
        padding: 20px;
    }
    
    .auth-title {
        font-size: 1.6em;
    }
    
    .input-field {
        padding: 12px 15px;
    }
}
.video-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.video-item:hover {
    background: #e9ecef;
}

.espejo-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}
/* Estilos específicos del dashboard */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.welcome-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    grid-column: 1 / -1;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-item {
    background: rgba(255,255,255,0.2);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

/* Layout para pantallas grandes */
@media (min-width: 1200px) {
    .dashboard-container {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }
    
    .full-width {
        grid-column: 1 / -1;
    }
}

/* Grid para espejos */
.espejos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.espejo-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 5px solid #667eea;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.espejo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Panel de control expandido */
.control-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.panel-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.panel-section.full-width {
    grid-column: 1 / -1;
}

/* Estadísticas mejoradas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

/* Gráficas más grandes */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.chart-mini-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    height: 300px;
    display: flex;
    flex-direction: column;
}

.chart-mini-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.chart-mini-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2c3e50;
    text-align: center;
}

.chart-mini-wrapper {
    position: relative;
    flex: 1;
    width: 100%;
}

/* Videos en grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.video-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
    transition: background 0.3s ease;
}

.video-card:hover {
    background: #e9ecef;
}

/* Header mejorado */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.header-info h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 2em;
}

.header-info p {
    margin: 5px 0 0 0;
    color: #7f8c8d;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Modal mejorado */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 30px;
    border-radius: 15px;
    width: 95%;
    height: 90%;
    max-width: 1400px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-title {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
}

.close-modal {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.close-modal:hover {
    background: #c0392b;
}

.modal-chart-wrapper {
    flex: 1;
    position: relative;
    min-height: 600px;
}

.expand-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.chart-mini-card:hover .expand-icon {
    opacity: 1;
}

.no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.chart-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.btn-small {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 10px;
        grid-template-columns: 1fr;
    }
    
    .control-panel {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .espejos-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-controls {
        justify-content: center;
    }
    
    .modal-content {
        width: 98%;
        height: 95%;
        margin: 1% auto;
        padding: 15px;
    }
}

/* Botones mejorados */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
}

/* Input fields mejorados */
.input-field {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: #667eea;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.config-item {
    margin-bottom: 0;
}

.config-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

/* ===================== UTILIDADES ===================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.p-20 { padding: 20px; }

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
