/**
 * ========================================
 * EL PATRÓN TIERRA - DASHBOARD STYLES
 * ========================================
 * Estilos para el panel de usuario
 */

/* ========================================
   LAYOUT BASE
   ======================================== */

.dashboard-page {
    display: flex;
    min-height: 100vh;
    background: var(--color-dark);
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: linear-gradient(180deg, rgba(20, 20, 20, 1) 0%, rgba(15, 15, 15, 1) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar__header {
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar__logo img {
    width: 44px;
    height: auto;
}

.sidebar__toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-gray-400);
    cursor: pointer;
    padding: 8px;
}

.sidebar__nav {
    flex: 1;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--color-gray-400);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all 0.3s ease;
}

.sidebar__link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-white);
}

.sidebar__link--active {
    background: rgba(201, 169, 98, 0.15);
    color: var(--color-gold);
}

.sidebar__link svg {
    flex-shrink: 0;
}

.sidebar__footer {
    padding: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar__logout {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    background: none;
    border: none;
    color: var(--color-gray-500);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar__logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.dashboard-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: var(--space-lg) var(--space-xl);
    background: rgba(15, 15, 15, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header__left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.dashboard-header__menu {
    display: none;
    background: none;
    border: none;
    color: var(--color-white);
    cursor: pointer;
    padding: 8px;
}

.dashboard-header__greeting h1 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 400;
    color: var(--color-white);
    margin-bottom: 4px;
}

.dashboard-header__greeting p {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
}

.dashboard-header__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-gold) 0%, #d4a853 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--color-dark);
    cursor: pointer;
}

/* ========================================
   DASHBOARD CONTENT
   ======================================== */

.dashboard-content {
    padding: var(--space-xl);
}

.dashboard-section {
    animation: fadeIn 0.3s ease;
}

.dashboard-section--hidden {
    display: none;
}

/* ========================================
   STATS GRID
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(201, 169, 98, 0.2);
    transform: translateY(-2px);
}

.stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gray-400);
}

.stat-card__icon--gold {
    background: rgba(201, 169, 98, 0.1);
    color: var(--color-gold);
}

.stat-card__icon--green {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-card__icon--purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.stat-card__value {
    display: block;
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 400;
    color: var(--color-white);
}

.stat-card__label {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
}

/* ========================================
   DASHBOARD CARDS
   ======================================== */

.dashboard-card {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.dashboard-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.dashboard-card__header h2 {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 400;
    color: var(--color-white);
}

.dashboard-card__link {
    font-size: var(--text-sm);
    color: var(--color-gold);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.dashboard-card__link:hover {
    opacity: 0.8;
}

/* ========================================
   CONTINUE LEARNING
   ======================================== */

.continue-learning__empty {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--color-gray-500);
}

.continue-learning__empty svg {
    margin-bottom: var(--space-md);
    opacity: 0.3;
}

.continue-learning__empty p {
    margin-bottom: var(--space-lg);
}

/* ========================================
   QUICK ACTIONS
   ======================================== */

.quick-actions {
    margin-bottom: var(--space-xl);
}

.quick-actions h2 {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 400;
    color: var(--color-white);
    margin-bottom: var(--space-md);
}

.quick-actions__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: var(--space-lg);
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    text-decoration: none;
    color: var(--color-gray-300);
    font-size: var(--text-sm);
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-action:hover {
    border-color: rgba(201, 169, 98, 0.3);
    transform: translateY(-4px);
}

.quick-action__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gray-400);
}

.quick-action__icon--gold {
    background: rgba(201, 169, 98, 0.15);
    color: var(--color-gold);
}

/* ========================================
   MY COURSES
   ======================================== */

.my-courses__empty {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--color-gray-500);
}

.my-courses__empty svg {
    margin-bottom: var(--space-md);
    opacity: 0.2;
}

.my-courses__empty h3 {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    color: var(--color-white);
    margin-bottom: var(--space-sm);
}

.my-courses__empty p {
    margin-bottom: var(--space-lg);
}

/* ========================================
   PROFILE FORM
   ======================================== */

.profile-form__avatar {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-gold) 0%, #d4a853 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--color-dark);
}

.profile-form__avatar-edit {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--color-gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.profile-form__avatar-edit:hover {
    background: var(--color-gold);
    color: var(--color-dark);
}

.profile-form__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.profile-form__group {
    margin-bottom: var(--space-md);
}

.profile-form__group--full {
    grid-column: span 2;
}

.profile-form__group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-gray-300);
    margin-bottom: 8px;
}

.profile-form__input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--color-white);
    transition: all 0.3s ease;
}

.profile-form__input:focus {
    outline: none;
    border-color: var(--color-gold);
}

.profile-form__input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-form__textarea {
    min-height: 100px;
    resize: vertical;
}

.profile-form__actions {
    margin-top: var(--space-lg);
}

.profile-form__message {
    margin-top: var(--space-md);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: var(--text-sm);
    display: none;
}

.profile-form__message.success {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.profile-form__message.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* ========================================
   SETTINGS
   ======================================== */

.settings-section {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h3 {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-gray-500);
    margin-bottom: var(--space-md);
}

.settings-section--danger h3 {
    color: #ef4444;
}

.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
}

.settings-option__title {
    display: block;
    font-weight: 500;
    color: var(--color-white);
    margin-bottom: 4px;
}

.settings-option__desc {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
}

/* Toggle switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle__slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    transition: all 0.3s ease;
}

.toggle__slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: var(--color-white);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle input:checked + .toggle__slider {
    background: var(--color-gold);
}

.toggle input:checked + .toggle__slider::before {
    transform: translateX(20px);
    background: var(--color-dark);
}

/* Settings buttons */
.settings-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--color-white);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.settings-btn--danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.settings-btn--danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar__toggle {
        display: block;
    }

    .dashboard-main {
        margin-left: 0;
    }

    .dashboard-header__menu {
        display: block;
    }
}

@media (max-width: 768px) {
    .dashboard-content {
        padding: var(--space-md);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-form__grid {
        grid-template-columns: 1fr;
    }

    .profile-form__group--full {
        grid-column: span 1;
    }

    .quick-actions__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
