/* ===== NURSING COLLEGE THEME - MATCHING SCREENSHOT ===== */
:root {
    /* Primary Colors from Screenshot */
    --bg-primary: #F8F8FC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F0F0F5;
    --bg-hover: #F5F5FA;
    
    /* Text Colors */
    --text-primary: #333333;
    --text-secondary: #4A4A4A;
    --text-muted: #666666;
    --text-light: #A0A0A0;
    --text-white: #FFFFFF;
    
    /* Purple Colors */
    --purple-primary: #6A5ACD;
    --purple-dark: #8A2BE2;
    --purple-light: #E0BBE4;
    --purple-bg: #F0F0F5;
    
    /* Pink Colors */
    --pink-primary: #FF69B4;
    --pink-light: #FFB6C1;
    
    /* Accent Colors */
    --accent-primary: #6A5ACD;
    --accent-secondary: #8A2BE2;
    --accent-success: #4CAF50;
    --accent-info: #2196F3;
    --accent-warning: #FF6347;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #FF69B4 0%, #8A2BE2 100%);
    --gradient-purple: linear-gradient(135deg, #6A5ACD 0%, #8A2BE2 100%);
    --gradient-pink-purple: linear-gradient(135deg, #FF69B4 0%, #6A5ACD 100%);
    
    /* Borders */
    --border-color: #E0E0E0;
    --border-light: #F0F0F0;
    --divider-color: #E5E5E5;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(106, 90, 205, 0.2);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Typography */
    --font-body: 'Inter', system-ui, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    
    /* Transitions */
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== BACKGROUND ===== */
.particles-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: var(--bg-primary);
    opacity: 1;
}

/* ===== MAIN LAYOUT ===== */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    background: var(--bg-primary);
}

/* ===== SIDEBAR NAVIGATION ===== */
.dashboard-nav {
    width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform var(--transition);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.nav-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--space-lg);
}

/* ===== LOGO SECTION ===== */
.logo-section {
    margin-bottom: var(--space-xl);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--purple-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.logo i {
    font-size: 1.75rem;
    color: var(--purple-dark);
    background: var(--purple-light);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.logo span {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-success);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.status-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== SEARCH BAR ===== */
.nav-search {
    margin-bottom: var(--space-lg);
    position: relative;
}

.nav-search input {
    width: 100%;
    padding: var(--space-md) var(--space-md) var(--space-md) 2.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    transition: all var(--transition);
}

.nav-search input:focus {
    outline: none;
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 3px rgba(106, 90, 205, 0.1);
}

.nav-search i {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: var(--font-size-md);
}

/* ===== PROJECT COUNTER ===== */
.project-counter {
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border-light);
}

.project-counter span {
    display: block;
    font-size: var(--font-size-2xl);
    font-weight: 800;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--space-xs);
}

.project-counter small {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== NAV ITEMS ===== */
.nav-items {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--purple-primary) transparent;
}

.nav-items::-webkit-scrollbar {
    width: 4px;
}

.nav-items::-webkit-scrollbar-track {
    background: transparent;
}

.nav-items::-webkit-scrollbar-thumb {
    background: var(--purple-primary);
    border-radius: 2px;
}

.nav-item {
    margin-bottom: var(--space-sm);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
}

.nav-link:hover {
    background: var(--bg-hover);
    border-color: var(--purple-light);
    transform: translateX(4px);
}

.nav-link.active {
    background: var(--gradient-purple);
    color: var(--text-white);
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.nav-link i {
    font-size: var(--font-size-md);
    color: var(--purple-primary);
}

.nav-link.active i {
    color: var(--text-white);
}

/* ===== TREE GROUP (DROPDOWN) ===== */
.nav-dropdown {
    margin-bottom: var(--space-sm);
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.dropdown-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--purple-light);
}

.dropdown-toggle.active {
    background: var(--bg-hover);
    border-color: var(--purple-primary);
}

.dropdown-toggle-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.dropdown-toggle-content i {
    color: var(--purple-primary);
    font-size: var(--font-size-md);
}

.dropdown-chevron {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    transition: transform var(--transition);
}

.dropdown-toggle.active .dropdown-chevron {
    transform: rotate(180deg);
}

.dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding-left: var(--space-lg);
    margin-top: var(--space-sm);
}

.dropdown-menu.show {
    max-height: 2000px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    border-radius: 8px;
    margin-bottom: var(--space-xs);
    transition: all var(--transition);
    border-left: 2px solid transparent;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-left-color: var(--purple-primary);
    padding-left: var(--space-lg);
}

.dropdown-item.active {
    background: var(--gradient-purple);
    color: var(--text-white);
    border-left-color: var(--purple-dark);
}

.dropdown-item i {
    font-size: var(--font-size-sm);
    opacity: 0.6;
}

.dropdown-item.active i {
    opacity: 1;
    color: var(--text-white);
}

/* ===== HEADER ACTIONS IN SIDEBAR ===== */
.header-actions {
    margin-top: auto;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--divider-color);
    display: flex;
    gap: var(--space-sm);
}

.action-btn {
    flex: 1;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.action-btn:hover {
    background: var(--gradient-purple);
    border-color: transparent;
    color: var(--text-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-btn i {
    font-size: var(--font-size-lg);
}

/* ===== MAIN CONTENT AREA ===== */
.dashboard-header {
    display: none;
}

.dashboard-main {
    margin-left: 320px;
    flex: 1;
    padding: var(--space-2xl);
    width: calc(100% - 320px);
    background: var(--bg-primary);
}

/* ===== CONTENT HEADER ===== */
.content-header {
    margin-bottom: var(--space-2xl);
}

.content-title {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    margin-bottom: var(--space-sm);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.content-subtitle {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
}

/* ===== WELCOME STATE ===== */
.welcome-state {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-state.hidden {
    display: none;
}

.welcome-content {
    max-width: 100%;
}

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

.stat-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: var(--space-xl);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--purple-light);
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: var(--space-md);
}

.stat-label {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    font-weight: 600;
}

/* ===== PROJECT VIEWER ===== */
.project-viewer {
    display: none;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    height: calc(100vh - 4rem);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.project-viewer.active {
    display: flex;
}

.project-viewer.maximized {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    z-index: 1000;
}

.viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 1000;
    pointer-events: auto;
}

.viewer-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: var(--text-primary);
}

.viewer-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.viewer-controls {
    display: flex;
    gap: var(--space-sm);
    position: relative;
    z-index: 1001;
    pointer-events: auto;
}

.control-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    z-index: 1002;
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.control-btn * {
    pointer-events: none;
}

.control-btn:hover {
    background: var(--gradient-purple);
    border-color: transparent;
    color: var(--text-white);
}

.close-btn:hover {
    background: var(--accent-warning);
    border-color: transparent;
    color: var(--text-white);
}

.viewer-content {
    flex: 1;
    position: relative;
    background: #ffffff;
    z-index: 1;
    overflow: hidden;
}

.loading-container {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 10;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--purple-light);
    border-top-color: var(--purple-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-text {
    margin-top: var(--space-lg);
    color: var(--text-secondary);
    font-weight: 600;
}

.project-frame {
    width: 100%;
    height: 100%;
    border: none;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

/* Ensure iframe doesn't block header */
.project-viewer.active .viewer-header {
    pointer-events: auto;
}

.project-viewer.active .viewer-header * {
    pointer-events: auto;
}

/* ===== AD SPACES ===== */
.header-ad-space,
.sidebar-ad-space,
.footer-ad-space,
.content-ad-space {
    margin: var(--space-xl) 0;
}

/* ===== MOBILE STYLES ===== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    width: 56px;
    height: 56px;
    background: var(--gradient-purple);
    border: none;
    border-radius: 50%;
    color: var(--text-white);
    font-size: var(--font-size-xl);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    transition: all var(--transition);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-nav-overlay {
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .dashboard-nav {
        transform: translateX(-100%);
    }
    
    .dashboard-nav.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    
    .dashboard-main {
        margin-left: 0;
        width: 100%;
        padding: var(--space-xl);
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition);
    }
    
    .mobile-nav-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 768px) {
    .dashboard-nav {
        width: 280px;
    }
    
    .dashboard-main {
        padding: var(--space-lg);
    }
    
    .welcome-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .dashboard-nav {
        width: 100%;
    }
    
    .content-title {
        font-size: var(--font-size-xl);
    }
    
    .mobile-menu-toggle {
        width: 48px;
        height: 48px;
        bottom: var(--space-lg);
        right: var(--space-lg);
    }
}

/* ===== UTILITY ===== */
.hidden {
    display: none !important;
}
