/* ==========================================================================
   DASHBOARD PREMIUM GLASSMORPHISM
   ========================================================================== */

body.dashboard-body {
    overflow: hidden;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body.dashboard-body .footer {
    display: none;
}

.dashboard-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    padding: 24px;
    height: calc(100vh - 74px);
    overflow: hidden;
}

/* 3D Glassy Sidebar */
.sidebar {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    height: 100%;
    position: relative;
    box-shadow: var(--glass-shadow);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--glass-border);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 4px 15px var(--primary-glow);
    flex-shrink: 0;
}

.user-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.user-info p { 
    color: var(--text-secondary); 
    font-size: 13px;
    margin-top: 4px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 32px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    transform: translateX(4px);
}

.menu-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px 12px 12px 4px;
}

.menu-icon {
    font-size: 18px;
    opacity: 0.8;
}

.sidebar-footer {
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

/* Token Box */
.token-display {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(15, 23, 42, 0.4);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--glass-border-light);
}

.token-icon {
    font-size: 24px;
}

.token-info p { 
    color: var(--text-secondary); 
    font-size: 12px; 
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.token-info h4 { 
    color: var(--text-primary); 
    font-size: 20px;
    margin: 0;
}

/* Dashboard Content Areas */
.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
    height: 100%;
    overflow-y: auto;
    padding-right: 16px;
}

.dashboard-content::-webkit-scrollbar {
    width: 6px;
}
.dashboard-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}
.dashboard-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
.dashboard-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.content-section { display: none; animation: fadeIn 0.4s ease-out; }
.content-section.active { display: block; }
.section-header { margin-bottom: 24px; }
.section-header h2 { font-size: 28px; margin-bottom: 8px; font-weight: 700; letter-spacing: -0.02em; }
.section-header p { color: var(--text-secondary); font-size: 15px; }

/* 3D Glass Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card, .quick-actions, .recent-activity, .skill-card, .booking-card, .review-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-border-light);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--glass-shadow);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover, .skill-card:hover, .booking-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-light);
}

.stat-card { display: flex; gap: 20px; align-items: center; cursor: pointer; }
.stat-icon { font-size: 32px; background: rgba(255,255,255,0.05); width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.stat-content { display: flex; flex-direction: column; gap: 4px; }
.stat-label { color: var(--text-secondary); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { color: var(--text-primary); font-size: 32px; font-weight: 700; line-height: 1; margin:0; }

/* Quick Actions */
.quick-actions h3, .recent-activity h3 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 16px;
}

.action-btn {
    padding: 20px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px dashed var(--glass-border-light);
    border-radius: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
}

.action-btn .action-icon {
    font-size: 24px;
    opacity: 0.8;
}

.action-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
    border-style: solid;
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Activity & Lists */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.activity-item {
    padding: 16px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 24px;
}

.skill-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skill-header h3 { margin: 0; font-size: 18px; color: var(--primary-color); }
.skill-level { font-size: 12px; padding: 4px 8px; background: rgba(255,255,255,0.1); border-radius: 4px; display: inline-block; margin-top: 8px;}
.skill-description { color: var(--text-secondary); font-size: 14px; line-height: 1.5; flex-grow: 1; }
.skill-meta { border-top: 1px solid var(--glass-border); padding-top: 16px; display: flex; justify-content: space-between; align-items: center;}
.skill-tokens { color: var(--text-primary); font-weight: 600; font-size: 15px;}
.skill-actions { display: flex; gap: 8px; }
.skill-actions button { padding: 8px 16px; border: none; border-radius: 8px; cursor: pointer; color: white; font-weight: 500; font-size: 13px; transition: opacity 0.2s; }
.skill-actions button:hover { opacity: 0.9; }
.skill-actions .edit-btn { background: var(--primary-color); }
.skill-actions .delete-btn { background: var(--accent-color); }

/* Bookings & Tabs */
.tabs { border-bottom: 1px solid var(--glass-border); margin-bottom: 24px; display: flex; gap: 32px; }
.tab { background: none; border: none; color: var(--text-muted); padding: 12px 0; cursor: pointer; font-weight: 500; font-size: 15px; position: relative; }
.tab.active { color: var(--text-primary); }
.tab.active::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; height: 2px; background: var(--primary-color); border-radius: 2px 2px 0 0; }

.bookings-list { display: flex; flex-direction: column; gap: 16px; }
.booking-card { display: flex; justify-content: space-between; align-items: center; padding: 20px; }
.booking-details h4 { margin: 0 0 4px 0; font-size: 16px; }
.booking-details p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.booking-actions { display: flex; gap: 12px; }

/* Messages */
.messages-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    min-height: 600px;
    overflow: hidden;
}

.conversations-list { 
    background: rgba(15, 23, 42, 0.4); 
    padding: 20px; 
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
}
.conversation-item { 
    padding: 16px; 
    margin-bottom: 8px; 
    border-radius: 12px; 
    cursor: pointer; 
    border: 1px solid transparent;
    transition: all 0.2s;
}
.conversation-item:hover { background: rgba(255,255,255,0.03); }
.conversation-item.active { 
    background: rgba(59, 130, 246, 0.1); 
    border-color: var(--glass-border-light);
}

/* Empty State */
.empty-state { color: var(--text-muted); text-align: center; padding: 60px 20px; font-size: 15px; background: rgba(15, 23, 42, 0.2); border-radius: 16px; border: 1px dashed var(--glass-border);}



@media (max-width: 992px) {
    .dashboard-container { grid-template-columns: 240px 1fr; }
}

@media (max-width: 768px) {
    body.dashboard-body { overflow-x: hidden; overflow-y: auto; }
    body.dashboard-body .footer { display: block; }
    .dashboard-container { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px; height: auto; overflow: visible; max-width: 100%; box-sizing: border-box; }
    .sidebar { position: relative; top: 0; margin-bottom: 16px; height: auto; padding: 20px; width: 100%; box-sizing: border-box; }
    .dashboard-content { height: auto; overflow-y: visible; padding-right: 0; width: 100%; box-sizing: border-box; overflow: hidden; }
    .sidebar-user { flex-direction: row; text-align: left; justify-content: flex-start; gap: 16px; }
    .sidebar-menu { flex-direction: row; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; -webkit-overflow-scrolling: touch; width: 100%; }
    .sidebar-menu::-webkit-scrollbar { height: 4px; display: none; } /* Hide scrollbar for cleaner look on mobile */
    .sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }
    .menu-item { white-space: nowrap; flex-shrink: 0; }
    .menu-item.active { border-left: none; border-bottom: 3px solid var(--primary-color); border-radius: 8px 8px 0 0; }
    .messages-container { grid-template-columns: 1fr; min-height: 400px; display: flex !important; flex-direction: column; width: 100%; }
    .conversations-list { border-right: none; border-bottom: 1px solid var(--glass-border); max-height: 200px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .tabs { flex-wrap: wrap; gap: 16px; }
    .stat-card, .quick-actions, .recent-activity, .skill-card, .booking-card, .review-card { padding: 16px; }
    .dashboard-container { padding: 12px; }
}

/* Chat UI Styling */
.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--glass-border-light);
    transition: background 0.2s;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.conversation-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--primary-color);
}

.conversation-info {
    flex: 1;
    overflow: hidden;
}

.conversation-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.conversation-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-bubble.sent {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--glass-border);
}

.chat-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

/* Chat Layout Classes from HTML */
.chat-messages-wrapper {
    display: flex;
    height: 600px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
}

.chat-sidebar {
    width: 300px;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

.chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
}

.chat-main-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.2);
}

.chat-header {
    padding: 16px;
    border-bottom: 1px solid var(--glass-border);
    display: none;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.chat-name {
    margin: 0;
    font-size: 16px;
}

.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-placeholder {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--glass-border);
    display: none;
}

.chat-form {
    display: flex;
    gap: 12px;
}

.chat-form input {
    flex: 1;
}

.chat-form button {
    padding: 0 24px;
}

@media (max-width: 768px) {
    .chat-messages-wrapper {
        flex-direction: column;
        height: auto;
    }
    .chat-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }
    
    /* Dashboard Mobile Layout */
    .sidebar {
        display: none;
    }
    .dashboard-content {
        padding-bottom: 80px;
    }
    .mobile-bottom-nav {
        display: flex !important;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Mobile Bottom Nav Styles */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    z-index: 1000;
    justify-content: space-around;
    padding: 12px 0 20px; /* extra padding for modern phones */
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.bottom-nav-item i {
    font-size: 20px;
}

.bottom-nav-item.active, .bottom-nav-item:hover {
    color: var(--primary-color);
}