/* ==================================
   BOB AI PLATFORM - MODULAR UI STYLES
   Windows 11 Compatible Design System
   ================================== */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Windows 11 Light Theme (Default) */
    --primary-bg: #f3f3f3;
    --header-bg: #ffffff;
    --content-bg: #ffffff;
    --sidebar-bg: #fafafa;
    --accent-color: #0078d4; /* Windows 11 Blue */
    --accent-light: #106ebe;
    --accent-dark: #005a9e;
    
    /* Text Colors */
    --text-light: #ffffff;
    --text-dark: #323130;
    --text-muted: #605e5c;
    --text-accent: #0078d4;
    
    /* UI Colors */
    --border-color: #e1dfdd;
    --border-light: #edebe9;
    --hover-bg: #f8f6f4;
    --hover-accent: #c7e0f4;
    
    /* Component Colors */
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --info-color: #2196f3;
    
    /* Typography */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-small: 12px;
    --font-size-normal: 14px;
    --font-size-large: 16px;
    --font-size-xl: 18px;
    --font-size-xxl: 24px;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Layout */
    --header-height: 50px;
    --sidebar-width: 300px;
    --footer-height: 40px;
    
    /* Shadows */
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Windows 11 Dark Theme */
@media (prefers-color-scheme: dark) {
    :root {
        /* Windows 11 Dark Theme Colors */
        --primary-bg: #1e1e1e;
        --header-bg: #2d2d30;
        --content-bg: #252526;
        --sidebar-bg: #1e1e1e;
        --accent-color: #60cdff; /* Windows 11 Dark Mode Blue */
        --accent-light: #9ecbff;
        --accent-dark: #0078d4;
        
        /* Text Colors */
        --text-light: #ffffff;
        --text-dark: #cccccc;
        --text-muted: #8c8c8c;
        --text-accent: #60cdff;
        
        /* UI Colors */
        --border-color: #3e3e42;
        --border-light: #464647;
        --hover-bg: #2a2d2e;
        --hover-accent: #005a9e;
        
        /* Dark Theme Shadows */
        --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.3);
        --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.4);
        --shadow-heavy: 0 8px 16px rgba(0, 0, 0, 0.5);
    }
}

/* Manual Dark Theme Override */
.dark-theme {
    /* Same colors as media query for manual switching */
    --primary-bg: #1e1e1e;
    --header-bg: #2d2d30;
    --content-bg: #252526;
    --sidebar-bg: #1e1e1e;
    --accent-color: #60cdff;
    --accent-light: #9ecbff;
    --accent-dark: #0078d4;
    
    --text-light: #ffffff;
    --text-dark: #cccccc;
    --text-muted: #8c8c8c;
    --text-accent: #60cdff;
    
    --border-color: #3e3e42;
    --border-light: #464647;
    --hover-bg: #2a2d2e;
    --hover-accent: #005a9e;
    
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-heavy: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* Base Body Styles */
body {
    font-family: var(--font-primary);
    font-size: var(--font-size-normal);
    line-height: 1.5;
    color: var(--text-dark);
    background: var(--primary-bg);
    min-height: 100vh;
}

/* Main App Container */
#app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--content-bg);
}

/* ==================================
   HEADER NAVIGATION
   ================================== */

#main-header {
    background: var(--header-bg);
    color: var(--text-light);
    height: var(--header-height);
    border-bottom: 1px solid var(--border-dark);
    box-shadow: var(--shadow-medium);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-content {
    position: relative; /* Added: Allows absolute positioning of project info */
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 var(--spacing-md);
    max-width: 1400px;
    margin: 0 auto;
    gap: var(--spacing-lg);
}

/* Brand Section */
.brand-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 200px;
}

.logo {
    height: 32px;
    width: auto;
}

.brand-text {
    font-size: var(--font-size-large);
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
}

/* Main Navigation */
.main-navigation {
    display: flex;
    flex: 1;
    gap: var(--spacing-xs);
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-button {
    background: none;
    border: none;
    color: #323130; /* Fixed: Changed from var(--text-light) to dark text for visibility on white header */
    font-size: var(--font-size-normal);
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-button:hover {
    background: var(--hover-bg);
    color: var(--accent-color); /* Better contrast on hover */
}

.nav-button.active {
    background: var(--accent-color);
    color: var(--text-light);
}

.dropdown-arrow {
    font-size: var(--font-size-small);
    transition: transform 0.2s ease;
}

.nav-item:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menus */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: var(--shadow-heavy);
    min-width: 180px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: #323130; /* Force dark text for visibility */
    text-decoration: none;
    font-size: var(--font-size-normal);
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--hover-bg);
    color: var(--text-accent);
}

/* User Actions */
.user-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-normal);
    width: 200px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(139, 58, 58, 0.2);
}

.search-button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: var(--spacing-xs);
    margin-left: -30px;
    z-index: 1;
}

.notification-button,
.settings-button,
.user-menu-button {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: var(--font-size-large);
    padding: var(--spacing-sm);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notification-button:hover,
.settings-button:hover,
.user-menu-button:hover {
    background: var(--hover-dark);
}

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

#main-content {
    flex: 1;
    display: flex;
    background: var(--content-bg);
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    margin-top: var(--header-height);
}

.content-wrapper {
    display: flex;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    height: calc(100vh - var(--header-height) - var(--footer-height));
    overflow: hidden;
}

/* Module Container */
#module-container {
    flex: 1;
    background: #000000;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    min-height: 600px;
    position: relative;
    overflow-y: auto;
    height: calc(100vh - var(--header-height) - var(--footer-height) - 32px);
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    gap: var(--spacing-md);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    height: calc(100vh - var(--header-height) - var(--footer-height) - 32px);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-section {
    background: var(--content-bg);
    border-radius: 6px;
    padding: var(--spacing-md);
    box-shadow: var(--shadow-light);
}

.sidebar-section h3 {
    font-size: var(--font-size-large);
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: var(--spacing-xs);
}

/* Calendar/Agenda Section */
.agenda-calendar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.calendar-day {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.calendar-day:hover {
    background: var(--hover-bg);
}

.day-number {
    background: var(--accent-color);
    color: var(--text-light);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-normal);
}

.day-name {
    font-weight: 500;
    color: var(--text-dark);
    min-width: 80px;
}

.day-date {
    color: var(--text-muted);
    font-size: var(--font-size-small);
}

/* Updates Counter */
.updates-counter {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.counter-number {
    display: block;
    font-size: var(--font-size-xxl);
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
}

.counter-label {
    font-size: var(--font-size-small);
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

/* Update Tabs */
.update-tabs {
    display: flex;
    gap: var(--spacing-xs);
}

.tab-button {
    flex: 1;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-small);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-button.active {
    background: var(--info-color);
    color: var(--text-light);
    border-color: var(--info-color);
}

.tab-button:not(.active):hover {
    background: var(--border-color);
}

/* System Status */
.system-status {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--border-color);
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    font-size: var(--font-size-small);
    color: var(--text-muted);
}

.status-value {
    font-weight: 500;
    color: var(--text-dark);
}

.status-value.online {
    color: var(--success-color);
    font-weight: 600;
}

/* ==================================
   FOOTER
   ================================== */

#main-footer {
    background: var(--header-bg);
    color: var(--text-light);
    height: var(--footer-height);
    border-top: 1px solid var(--border-dark);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--spacing-md);
    max-width: 1400px;
    margin: 0 auto;
}

.footer-left,
.footer-right {
    font-size: var(--font-size-small);
    color: var(--text-muted);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.footer-separator {
    color: var(--text-muted);
}

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

/* Tablet Layout */
@media (max-width: 1024px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: none;
        order: 2;
    }
    
    #module-container {
        order: 1;
    }
    
    .main-navigation {
        gap: 0;
    }
    
    .nav-button {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-small);
    }
}

/* Mobile Layout */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
        --sidebar-width: 100%;
    }
    
    .header-content {
        flex-wrap: wrap;
        padding: var(--spacing-sm);
        height: auto;
        min-height: var(--header-height);
    }
    
    .brand-section {
        min-width: auto;
    }
    
    .brand-text {
        font-size: var(--font-size-normal);
    }
    
    .main-navigation {
        flex-wrap: wrap;
        width: 100%;
        order: 3;
        margin-top: var(--spacing-sm);
    }
    
    .user-actions {
        order: 2;
        margin-left: auto;
    }
    
    .search-input {
        width: 150px;
    }
    
    .nav-button {
        font-size: var(--font-size-small);
        padding: var(--spacing-xs);
    }
    
    .content-wrapper {
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
    }
    
    .sidebar-section {
        padding: var(--spacing-sm);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .brand-text {
        display: none;
    }
    
    .search-container {
        display: none;
    }
    
    .main-navigation {
        gap: var(--spacing-xs);
    }
    
    .nav-button {
        padding: var(--spacing-xs);
        font-size: 12px;
    }
    
    .dropdown-arrow {
        display: none;
    }
}

/* ==================================
   UTILITY CLASSES
   ================================== */

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-bold {
    font-weight: 600;
}

.font-normal {
    font-weight: 400;
}

.text-muted {
    color: var(--text-muted);
}

.text-accent {
    color: var(--text-accent);
}

.bg-accent {
    background-color: var(--accent-color);
    color: var(--text-light);
}

.margin-top {
    margin-top: var(--spacing-md);
}

.margin-bottom {
    margin-bottom: var(--spacing-md);
}

.padding {
    padding: var(--spacing-md);
}

.border-radius {
    border-radius: 4px;
}

.shadow {
    box-shadow: var(--shadow-light);
}

/* Focus states for accessibility */
*:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}