/* style.css */
:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #6366f1;
    --accent-color: #818cf8;
    --text-color: #1e293b;
    --text-light: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    font-size: 16px;
}

body {
    background: linear-gradient(135deg, #dee3f7 0%, #ffffff 100%);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Login Styles */
.login-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #d3ccdb 100%);
    
}

.login-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    animation: fadeIn 0.5s ease;
    margin-top: 10px;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 10px 5px;
    text-align: center;
}

.login-header i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.login-header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.login-header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.login-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.1rem;
}

.input-icon input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-color);
}

.input-icon input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
    background: white;
}

.input-icon input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-btn i {
    font-size: 1.1rem;
}

/* Mensajes */
.message-container {
    margin-top: 20px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    width: 100%;
    animation: fadeIn 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.4;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer del login */
.login-footer {
    text-align: center;
    margin-top: 15px;
    padding: 0 30px 25px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-box {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

.modal-box h2 {
    margin-top: 0;
    color: var(--text-color);
    font-size: 1.5em;
    margin-bottom: 15px;
}

.modal-box p {
    color: var(--text-light);
    margin: 10px 0;
    line-height: 1.6;
}

.modal-icon {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.activation-date {
    font-size: 1rem;
    margin-top: 15px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--text-color);
    background: var(--bg-color);
}

/* Dashboard Styles */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-header i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
}

.user-info {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
}

.user-avatar i {
    font-size: 3rem;
    color: var(--accent-color);
}

.user-details h3 {
    font-size: 1.1rem;
    margin-bottom: 3px;
}

.user-details p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.sidebar-menu ul {
    list-style: none;
    padding: 15px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-menu li a:hover {
    background: var(--bg-color);
}

.sidebar-menu li a.active {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--danger-color);
    text-decoration: none;
    font-weight: 500;
    padding: 12px 15px;
    border-radius: 6px;
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 20px;
    transition: var(--transition);
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.main-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-color);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

.content-section {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    overflow: hidden;
}

.section-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.section-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--primary-dark);
}

.menu-options {
    padding: 25px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.menu-card {
    background: var(--bg-color);
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.menu-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.menu-icon i {
    font-size: 2rem;
    color: white;
}

.menu-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.menu-card p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.menu-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.menu-btn:hover {
    background: var(--primary-dark);
}

.activity-list {
    padding: 20px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: var(--transition);
}

.activity-item:hover {
    background: var(--bg-color);
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    font-size: 1rem;
    margin-bottom: 3px;
}

.activity-content p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Móviles */
    html {
        font-size: 14px;
    }
    
    .login-container {
        padding: 10px;
    }
    
    .login-card {
        max-width: 100%;
        border-radius: 12px;
    }
    
    .login-header {
        padding: 25px 15px;
    }
    
    .login-header i {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .login-form {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .input-icon input {
        padding: 12px 15px 12px 40px;
    }
    
    .input-icon i {
        left: 12px;
    }
    
    .login-btn {
        padding: 14px;
    }
    
    .modal-box {
        padding: 30px 20px;
    }
    
    .modal-box h2 {
        font-size: 1.3rem;
    }
    
    .modal-close {
        top: 10px;
        right: 10px;
    }
    
    /* Dashboard responsive */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-options {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .activity-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .activity-time {
        margin-top: 5px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Tablets */
    .login-card {
        max-width: 380px;
    }
    
    .menu-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
    }
}

@media (min-width: 1025px) {
    /* Desktop */
    .menu-options {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Utilidades para accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --text-color: #000000;
        --border-color: #000000;
    }
}

/* Optimización para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .login-btn {
        min-height: 48px;
    }
    
    .input-icon input {
        min-height: 44px;
    }
}

/* Rotación de dispositivos */
@media (orientation: landscape) and (max-height: 500px) {
    .login-container {
        padding: 5px;
    }
    
    .login-card {
        max-width: 90%;
    }
    
    .login-header {
        padding: 15px;
    }
}