/* ============================================
   sparQ Desktop Layout Styles
   Desktop-only components extracted from base.css
   ============================================ */

/* Header Styles */
.app-header {
    background-color: var(--color-white);
    border-bottom: 3px solid;
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom-color: var(--module-color, var(--color-primary));
    position: sticky;
    top: 0;
    z-index: 1030;
    margin-left: -1.5rem;  /* Compensate for body padding */
    margin-right: -1.5rem; /* Compensate for body padding */
}

/* Core app specific */
.core-app .app-header {
    border-bottom-color: var(--color-gray-500);
}

/* Remove all other app-specific styles */

/* App Title and Navigation */
.app-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 0;     /* Ensure no margin on left */
}

.app-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-logo-link {
    display: flex;
    align-items: center;
}

.app-logo {
    height: 40px;
    width: auto;
}

.app-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    color: var(--color-gray-900);
    text-decoration: none;
}

.app-name:hover {
    color: var(--color-gray-700);
    text-decoration: none;
}

/* Standalone App Branding (Zoho-style) */
.app-branding {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.app-icon-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--app-color, var(--color-gray-500));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.app-logo-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-gray-900);
}

.app-branding:hover {
    text-decoration: none;
}

.app-branding:hover .app-logo-name {
    color: var(--app-color);
}

.app-title-divider {
    width: 1px;
    height: 30px;
    background-color: var(--color-gray-300);
    margin: 0 0.5rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;  /* Keep header content aligned */
    width: 100%;        /* Ensure full width */
}

/* User Navigation */
.user-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-right: 0;    /* Ensure no margin on right */
}

.company-name-label {
    font-size: 1rem;
    font-weight: 600;
    /* color: var(--color-gray-900); */
    color: var(--module-color, var(--color-gray-900));
}

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

.user-name {
    font-weight: 500;
    color: var(--color-gray-900);
}

/* App Name Button in Header (clickable to open launcher) */
.app-name-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: transparent;
    border: 2px solid transparent;
    color: var(--app-color, var(--color-gray-700));
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    text-decoration: none;
    position: relative;
}

.app-name-btn:hover {
    background: transparent;
    border-color: var(--app-color, var(--color-gray-700));
    color: var(--app-color, var(--color-gray-700));
    text-decoration: none;
}

/* Chevron appears on hover (Odoo-style) */
.app-name-btn .chevron-icon {
    font-size: 0.7rem;
    opacity: 0;
    transform: translateX(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    color: inherit;
}

.app-name-btn:hover .chevron-icon {
    opacity: 0.7;
    transform: translateX(0);
}

.app-name-btn .app-icon {
    font-size: 1.1rem;
}

/* sparQ logo button (for core app) */
.app-logo-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    background: transparent;
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    text-decoration: none;
}

.app-logo-btn:hover {
    background: transparent;
    border-color: var(--color-primary);
}

.app-logo-btn img {
    height: 28px;
}

.app-logo-btn .chevron-icon {
    font-size: 0.7rem;
    opacity: 0;
    color: var(--color-primary);
    transition: opacity 0.15s ease;
}

.app-logo-btn:hover .chevron-icon {
    opacity: 0.7;
}

/* Keyboard Shortcut Hint */
.keyboard-hint {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 1rem;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s ease;
}

.keyboard-hint:hover {
    opacity: 0.7;
}

.keyboard-hint .kbd-key,
.keyboard-hint .kbd-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    min-width: 20px;
    padding: 0 4px;
    font-size: 0.7rem;
    font-family: var(--font-family-sans);
    font-weight: 500;
    color: var(--color-gray-500);
    background: var(--color-gray-100);
    border: 1px solid var(--color-gray-300);
    border-radius: 4px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

/* Platform-specific modifier key - set via JS */
.keyboard-hint .kbd-key::before {
    content: var(--kbd-modifier, '\2318'); /* Default: Mac Command symbol */
}

/* Notification Bell */
.notification-bell-btn {
    text-decoration: none;
    border: none;
    background: none;
}

.notification-bell-btn:hover {
    background: var(--color-gray-100);
    border-radius: 50%;
}

.notification-bell-btn:focus {
    box-shadow: none;
}

.notification-dropdown {
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 350px;
    max-height: 450px;
    overflow-y: auto;
}

.notification-dropdown-header {
    background: var(--color-gray-50);
}

.notification-list .notification-item {
    transition: background-color 0.15s ease;
}

.notification-list .notification-item:hover {
    background: var(--color-gray-50);
}

.notification-list .notification-item.unread {
    background: color-mix(in srgb, var(--color-primary) 5%, transparent);
}

.notification-list .notification-item.unread:hover {
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.notification-icon {
    width: 24px;
    text-align: center;
}

.notification-actions button {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.notification-item:hover .notification-actions button {
    opacity: 1;
}

.notification-footer {
    background: var(--color-gray-50);
}

.notification-footer a {
    color: var(--color-primary);
}

.notification-footer a:hover {
    color: var(--color-primary-dark);
}

/* Notification bell icon */
.notification-bell-icon {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Notification count badge */
.notification-badge {
    font-size: 0.6rem;
}

/* ============================================
   Module Layout - Sidebar & Content
   ============================================ */

/* Side Navigation */
.side-nav {
    width: 240px;
    min-width: 250px;
    flex: 0 0 240px;
    background: var(--color-white);
    border-radius: 0.5rem;
    border: 1px solid var(--color-gray-300);
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    height: 100%;
    overflow-y: auto;
    position: relative;
    padding-bottom: 3rem;
}

.nav-menu { list-style: none; padding: 0; margin: 0; }
.nav-item {
    margin-bottom: 0.125rem;
    display: flex;
    align-items: center;
}
.nav-item:last-child { margin-bottom: 0; }

.nav-item .nav-link {
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    color: var(--color-gray-700);
    font-weight: normal;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: var(--color-gray-100);
    color: var(--color-gray-900);
}

.nav-link.active {
    background: color-mix(in srgb, var(--module-color) 12%, transparent);
    color: var(--color-gray-900);
    font-weight: 500;
}

.nav-link i {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
    color: var(--color-gray-500);
    opacity: 0.7;
}

.nav-link:hover i,
.nav-link.active i {
    color: var(--section-color, var(--color-gray-700));
    opacity: 1;
}

.nav-link.disabled {
    color: var(--color-gray-400);
    pointer-events: none;
    cursor: default;
}

.nav-link.disabled i {
    color: var(--color-gray-400);
    opacity: 0.5;
}

.nav-item:has(.nav-link.disabled) {
    cursor: help;
}

/* Navigation Sections */
.nav-section {
    margin-bottom: 0.25rem;
    list-style: none;
}

.nav-section-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem 0.125rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--section-color, var(--color-gray-500));
}

.nav-section-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-section-items .nav-item {
    margin-bottom: 0;
}

.nav-section-items .nav-link {
    padding: 0.375rem 1rem;
}

.nav-divider {
    height: 1px;
    background: var(--color-gray-300);
    margin: 0.5rem 1rem;
    list-style: none;
}

.nav-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-gray-500);
    padding: 0.5rem 1rem;
    margin-top: 0.25rem;
    list-style: none;
}

/* Collapsible Nav Sections */
.nav-section-collapsible .nav-section-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 1rem;
    transition: color 0.15s ease;
}

.nav-section-collapsible .nav-section-header:hover {
    color: color-mix(in srgb, var(--section-color, var(--color-gray-700)) 80%, black);
}

.nav-section-toggle {
    user-select: none;
}

.nav-section-toggle span {
    flex: 1;
}

.nav-section-chevron {
    font-size: 0.6rem;
    transition: transform 0.2s ease;
    color: var(--color-gray-400);
}

.nav-section-chevron.rotated {
    transform: rotate(180deg);
}

/* ============================================
   Sidebar Editing (Shared Components)
   ============================================ */

/* Drag handle */
.drag-handle {
    cursor: grab;
    color: var(--color-gray-400);
    margin-right: 0.5rem;
    font-size: 0.8rem;
}

.drag-handle:active {
    cursor: grabbing;
}

/* SortableJS ghost and chosen styling */
.sortable-ghost {
    opacity: 0.4;
    background: var(--color-gray-100);
}

.sortable-chosen {
    background: var(--color-primary-lightest);
}

/* Content Area */
.content-wrapper {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    overflow-x: auto;  /* Allow horizontal scroll if content is wider than viewport */
    margin-left: 1.5rem;  /* Space between sidebar and content */
}

.content-card {
    background: var(--color-white);
    padding: 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--color-gray-300);
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    flex: 1;
    min-width: 1100px;  /* Minimum width - content won't shrink below this */
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .side-nav,
    .no-print,
    .dropdown,
    .app-header {
        display: none !important;
    }

    .content-wrapper {
        margin: 0 !important;
        padding: 0 !important;
    }

    body {
        background: var(--color-white);
        padding: 0;
    }
}

/* Hamburger menu - hidden by default, shown via JS for narrow viewports */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    cursor: pointer;
}

.mobile-menu-toggle i {
    font-size: 1.25rem;
    color: var(--color-gray-500);
}

.mobile-menu-toggle:hover {
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
}
