/* Import the global CSS variables */
@import url('global.css');

/* App layout with horizontal header */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    font-family: var(--body-font);
    background-color: var(--light-gray);
    color: var(--text-color);
}

/* Typography styles */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 600;
    margin-top: 0;
}

p, span, a, button, input, select, textarea, label, li {
    font-family: var(--body-font);
}

/* Horizontal navigation header for myLaundry application */
.site-header {
    background-color: #102864;
    color: white;
    width: 100%;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 997;
    position: sticky;
    top: 0;
}

.header-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1.5rem;
    max-width: 100%;
    gap: 1rem;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    flex-shrink: 0;
}

.header-logo img {
    max-height: 40px;
    width: auto;
}

.header-search {
    flex-grow: 1;
    max-width: 500px;
    margin: 0 auto;
}

.header-search input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    text-align: center;
}

.header-search input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.header-search input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Body transition when menu is open */
body {
    transition: margin-left 0.3s ease;
}

body.menu-open {
    margin-left: 280px;
}

/* Menu Overlay */
.menu-overlay {
    display: none;
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background-color: #f8f9fa;
    box-shadow: inset -2px 0 12px rgba(0,0,0,0.05);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
}

.side-menu.active {
    transform: translateX(0);
}

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background-color: white;
}

.side-menu-header h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.25rem;
    font-family: var(--heading-font);
}

.menu-close-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 6px;
}

.menu-close-btn:hover {
    background-color: #e9ecef;
    color: #2c3e50;
}

.menu-close-btn svg {
    width: 24px;
    height: 24px;
}

.header-nav-items {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 1rem 0;
    flex-grow: 1;
    overflow-y: auto;
    background-color: #f8f9fa;
}

.header-nav-items li {
    position: relative;
    white-space: nowrap;
}

.header-nav-items a {
    color: #495057;
    text-decoration: none;
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
    font-size: 0.95rem;
    border-radius: 8px;
    margin: 0.25rem 0.75rem;
}

.header-nav-items a:hover {
    background-color: #e9ecef;
    color: #212529;
}

.header-nav-items a.active,
.header-nav-items li a.active {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.menu-toggle-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    border-radius: 6px;
}

.menu-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-toggle-btn svg {
    width: 24px;
    height: 24px;
}

.header-user-section {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

/* Notification Icon */
.notification-icon {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
}

.notification-icon:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.notification-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ffb3ba;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 8px rgba(255, 179, 186, 0.4);
    border: 2px solid #102864;
}

/* User Menu Trigger */
.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    border-radius: 12px;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
}

.user-menu-trigger:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.user-menu-icon {
    width: 18px;
    height: 18px;
    color: white;
    transition: transform 0.2s;
}

.user-menu-trigger:hover .user-menu-icon {
    transform: translateY(2px);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffe6a7;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: var(--heading-font);
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(255, 230, 167, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-avatar-large {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ffe6a7;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    font-family: var(--heading-font);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 230, 167, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.header-user-name {
    font-weight: 500;
    font-family: var(--heading-font);
    white-space: nowrap;
    font-size: 0.9rem;
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    position: relative;
    border-bottom: 1px solid #f1f3f5;
}

.user-dropdown-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.user-dropdown-name {
    font-weight: 600;
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    font-family: var(--heading-font);
}

.user-dropdown-role {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: capitalize;
}

.user-dropdown-divider {
    height: 1px;
    background: #f1f3f5;
    margin: 0.5rem 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.5rem;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
}

.user-dropdown-item:hover {
    background: linear-gradient(90deg, #f8f9fa 0%, #fff 100%);
    color: #667eea;
    padding-left: 1.75rem;
}

.user-dropdown-item i,
.user-dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.logout-btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-family: var(--body-font);
    transition: background-color 0.2s;
    white-space: nowrap;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Icon styling for Feather icons */
.header-nav-items li a svg {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    vertical-align: middle;
    stroke-width: 2px;
    color: currentColor;
}

.header-nav-items a.active svg {
    color: white;
}

/* Main content area */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    width: 100%;
}

/* Container adjustments for flex layout */
.container {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 1rem;
    min-height: 100%;
}

/* Card layout improvements */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Slightly wider cards */
    gap: 1.25rem; /* Slightly reduced gap */
    margin-bottom: 1.5rem; /* Reduced bottom margin */
}

.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.25rem; /* Slightly reduced padding */
    transition: transform 0.3s ease;
}

/* Welcome section adjustments */
.welcome-section {
    text-align: center;
    margin-bottom: 1.5rem; /* Reduced margin */
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem; /* Reduced padding */
}

/* Quick stats adjustments */
.quick-stats {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.25rem; /* Reduced padding */
    margin-bottom: 1.5rem; /* Reduced margin */
}

/* Responsive adjustments */
@media (min-width: 1600px) {
    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); /* Wider cards on large screens */
    }
}

/* Scrollbar styling for side menu */
.header-nav-items::-webkit-scrollbar {
    width: 6px;
}

.header-nav-items::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.header-nav-items::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.header-nav-items::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* For smaller screens */
@media (max-width: 768px) {
    .header-container {
        padding: 0.5rem 1rem;
    }

    .header-logo img {
        max-height: 32px;
    }

    .header-search {
        flex-grow: 1;
        margin: 0 1rem;
        max-width: none;
    }

    .side-menu {
        width: 75%;
        max-width: 280px;
    }

    body.menu-open {
        margin-left: 75%;
    }

    .main-content {
        padding: 0.5rem;
    }

    .container {
        padding: 0.5rem;
        margin: 0;
    }

    .header-user-section {
        margin-left: 0;
        gap: 0.5rem;
    }

    .header-user-name {
        display: none; /* Hide username on mobile to save space */
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .user-menu-trigger {
        padding: 0.25rem 0.5rem;
    }

    .user-menu-icon {
        width: 16px;
        height: 16px;
    }

    .user-dropdown {
        right: -1rem;
        min-width: 240px;
    }

    .notification-icon {
        width: 36px;
        height: 36px;
    }

    .notification-icon svg {
        width: 20px;
        height: 20px;
    }

    .notification-badge {
        top: 4px;
        right: 4px;
        min-width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
}

/* Override any potentially hardcoded blue colors throughout the app */
.header-nav-items a.active,
.btn-primary,
.primary-bg,
.primary-color,
.primary-text,
.theme-color,
.badge-primary,
.page-header,
.active-item,
.card-header-tabs .nav-link.active,
.chart-color-primary,
[data-primary-color],
.light-blue,
.light-blue-bg,
[style*="light-blue"],
[style*="3498db"],
[style*="4299e1"],
[style*="59a0ff"],
[style*="63b3ed"],
[style*="0290ff"],
[style*="62b5e5"],
[style*="4099ff"],
[style*="38b2ac"],
[style*="2c9faf"],
[style*="00d0f1"] {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

.text-primary,
.card-link,
.link-color,
.primary-link,
.theme-link,
.nav-link.active,
.link-primary,
a.primary {
    color: var(--primary-color) !important;
}

.border-primary,
.primary-border,
.highlight-border {
    border-color: var(--primary-color) !important;
}

.secondary-bg,
.secondary-color,
.btn-secondary,
.badge-secondary,
.theme-accent {
    background-color: var(--secondary-color) !important;
    color: black !important;
    border-color: var(--secondary-color) !important;
}

.text-secondary,
.card-secondary-link,
.secondary-link,
.link-secondary {
    color: var(--secondary-color) !important;
}

.border-secondary,
.secondary-border {
    border-color: var(--secondary-color) !important;
}