﻿/* layout.css — layout-specific styles */

/* Sidebar base */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: #f9fafb;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: width .22s ease-in-out, transform .22s ease-in-out, padding .22s ease-in-out;
    overflow-y: auto;
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}
    .sidebar::-webkit-scrollbar {
        display: none; 
    }

.sidebar-toggle {
    border: none;
}
/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    position: relative;
    overflow: hidden;
}

.brand-text span:first-child {
    font-weight: 600;
    letter-spacing: 0.03em;
    font-size: 1.05rem;
}

.brand-text span:last-child {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Sidebar menu */
.sidebar-menu {
    list-style: none;
    padding-left: 0;
    margin-top: 6px;
}

.menu-item {
    position: relative;
    margin-bottom: 2px;
}

/* menu-link wrapper */
.menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

    .menu-link > a.main-link,
    .menu-link > a.menu-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        border-radius: 12px;
        color: #e5e7eb;
        text-decoration: none;
        transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
        font-size: 0.95rem;
        width: 100%;
    }

.menu-item .icon {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* submenu toggle button (small chevron) */
.submenu-toggle {
    background: transparent;
    border: none;
    color: #e5e7eb;
    padding: 1px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .submenu-toggle:hover {
        background: rgba(255,255,255,0.03);
    }

.menu-item > .menu-link > a.main-link:hover,
.menu-item > a.menu-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    transform: translateX(2px);
}

.menu-item.active > .menu-link > a.main-link,
.menu-item.active > a.menu-link {
    background: rgba(255, 65, 108, .1);
    color: #fff;
    transform: translateX(2px);
}

/* Submenu */
.submenu {
    list-style: none;
    margin: 16px 0 12px 0;
    padding-left: 16px;
}

    .submenu li a {
        display: block;
        padding: 8px 12px;
        border-radius: 8px;
        color: #e5e7ebca;
        text-decoration: none;
        font-size: 0.8rem;
    }

        .submenu li a:hover {
            background: rgba(255,255,255,0.03);
            color: #fff;
        }

        .submenu li a.active {
            background: rgba(255,255,255,0.05);
            color: #fff;
        }

/* rotate chevron when open */
.menu-item.open > .menu-link .chev {
    transform: rotate(180deg);
    transition: transform .18s ease;
}

/* Main area — default for desktop */
.main {
    margin-left: 260px;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: margin-left .22s ease-in-out, padding .22s ease-in-out;
    min-height: 100vh;
    z-index: 1;
}

/* overlay */
.sidebar-overlay {
    display: none;
}

/* MOBILE: collapsed icon rail instead of hiding sidebar */
@media (max-width: 992px) {
    /* default to icon-only rail */
    .sidebar {
        width: 82px;
        padding: 16px 8px;
        overflow: visible; /* allow submenu popover */
    }

    /* main responds to the rail */
    .main {
        margin-left: 82px;
        padding: 16px;
    }

    /* hide brand text & menu labels */
    .brand-text {
        display: none;
    }

    .sidebar-toggle {
        display: inline-block;
    }

    .menu-link > a.main-link,
    .menu-link > a.menu-link {
        padding: 10px 8px;
        justify-content: start; /* center icons */
    }

    /* hide textual label but keep icon visible */
    .menu-link .label {
        display: none;
    }

    /* keep chevron visible (small) */
    .submenu-toggle {
        display: inline-flex;
    }

    /* popover submenu (hidden by default) — absolute next to rail */
    .submenu {
        position: absolute;
        left: 82px; /* popover anchored to the icon rail */
        top: 0;
        width: 220px;
        background: var(--sidebar-bg);
        color: var(--text-main);
        border-radius: 10px;
        box-shadow: 0 10px 30px rgba(15,23,42,0.12);
        padding: 8px;
        z-index: 1060;
        display: none; /* override via JS when open */
    }

        .submenu li a {
            color: #e5e7eb;
        }

    /* show inline submenu only when the sidebar is expanded */
    .sidebar.expanded .submenu {
        position: static;
        display: block;
        width: auto;
        background: transparent;
        box-shadow: none;
        padding-left: 16px;
    }

    /* when the item is open, show popover */
    .menu-item.open > .submenu {
        display: block;
    }

    /* expanded full sidebar overlay style */
    .sidebar.expanded {
        width: 260px;
        padding: 24px 20px;
        transform: translateX(0);
    }

        .sidebar.expanded .brand-text {
            display: flex;
        }

        .sidebar.expanded .menu-link > a.main-link,
        .sidebar.expanded .menu-link > a.menu-link {
            justify-content: flex-start;
        }

        .sidebar.expanded .menu-link .label {
            display: inline;
        }

    /* overlay when expanded */
    .sidebar-overlay.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 1050;
    }
}

/* Desktop (>=993px) behavior - full sidebar */
@media (min-width: 993px) {
    .sidebar {
        width: 260px;
        padding: 24px 20px;
    }

    .main {
        margin-left: 260px;
        padding: 24px 32px;
    }

    .sidebar-toggle {
        display: none;
    }

    .brand-text {
        display: block;
    }

    .menu-link .label {
        display: inline;
    }

    .submenu {
        position: static;
        display: block;
        padding-left: 38px;
        margin-top: 6px;
    }

        .submenu[hidden] {
            display: none;
        }
}

/* small screen content grid helper */
@media (max-width: 960px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 600;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0px;
    font-weight: 100;
}

.topbar-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search {
    position: relative;
}

    .search input {
        border-radius: 10px;
        border: 1px solid var(--border-soft);
        padding: 8px 32px 8px 12px;
        font-size: 0.85rem;
        outline: none;
        background: #ffffff;
    }

    .search::after {
        content: "🔍";
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.9rem;
        opacity: 0.7;
    }

.icon-btn {
    border: none;
    outline: none;
    background: #ffffff;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

    .icon-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
        background: #f9fafb;
    }

.user-area .btn {
    background: #ffffff;
    border-radius: 10px;
    padding: 6px 10px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 500;
    background: linear-gradient(135deg,#ff416c,#ff7b34);
    margin-right: 8px;
}

.user-area .user-info {
    line-height: 1;
}

.user-area .dropdown-menu {
    min-width: 200px;
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(15,23,42,0.12);
}

.nav-underline .nav-link {
    position: relative;
    padding-bottom: .45rem;
    color: inherit;
    background: transparent;
}

    .nav-underline .nav-link::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        height: 3px;
        width: 0%;
        /* background: #FF6731;  matches the primary button start color */
        border-radius: 3px;
        color: #FF6731;
        transition: width .22s ease;
    }

    .nav-underline .nav-link.active, .nav-underline .show > .nav-link {
        border-bottom-color: var( --primary);
    }

        .nav-underline .nav-link:hover::after,
        .nav-underline .nav-link.active::after {
            width: 100%;
        }

    /* prevent default focus/hover underline or black outline */
    .nav-underline .nav-link:hover,
    .nav-underline .nav-link:focus {
        text-decoration: none;
        box-shadow: none;
        outline: none;
    }

/* Use gradient for active/show nav link text (match primary button) */
.navbar-nav .nav-link.active,
.navbar-nav .nav-link.show {
    background: linear-gradient(135deg, #FF6731 0%, #FF4761 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent; /* allow the gradient to show through */
}

.navbar {
    padding-top: 0px;
    padding-bottom: 0px;
}

/*Manage User Account Links*/
/* Manage sub-nav — card + nav styles that match site design tokens */
.manage-nav .card {
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
}

/* Base link look inside the card */
.manage-nav .nav-link {
    color: #374151; /* neutral, matches body text */
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
    display: block;
    text-decoration: none;
}

    /* subtle hover */
    .manage-nav .nav-link:hover,
    .manage-nav .nav-link:focus {
        color: var(--primary);
        background: rgba(255, 71, 97, 0.06); /* gentle tint using brand */
        transform: translateX(2px);
        text-decoration: none;
    }

    /* active state — support both Bootstrap's `active` and the existing `text-primary` helper */
    .manage-nav .nav-link.active,
    .manage-nav .nav-link.text-primary {
        color: var(--primary);
        font-weight: 600;
        /* soft background gradient echoing primary */
        background: linear-gradient(180deg, rgba(255,65,108,0.06), rgba(255,123,52,0.04));
        /* left accent bar to match the product's gradient motif */
        position: relative;
        padding-left: calc(0.75rem + 8px);
    }

        /* left accent indicator */
        .manage-nav .nav-link.active::before,
        .manage-nav .nav-link.text-primary::before {
            content: "";
            position: absolute;
            left: 10px; /* sits inside the padding-left area */
            top: 10%;
            bottom: 10%;
            width: 4px;
            border-radius: 6px;
            background: linear-gradient(180deg, var(--primary), var(--primary-alt));
        }

    /* keep clickable area clear of the accent */
    .manage-nav .nav-link > * {
        margin-left: 6px;
    }

/* underline variant fallback for tighter horizontal tab look */
.manage-nav .nav-underline .nav-link {
    padding-bottom: .5rem;
    background: transparent;
}

    /* reuse nav-underline underline animation (global) — ensure the after color uses the primary */
    .manage-nav .nav-underline .nav-link::after {
        background: var(--primary);
    }

/* Responsive: on small screens we switch to a scrollable horizontal tab bar */
@media (max-width: 767px) {
    .manage-nav .card {
        padding: 8px;
    }

    .manage-nav .nav {
        display: flex;
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        white-space: nowrap;
    }

    .manage-nav .nav-link {
        display: inline-block;
        padding: 0.45rem 0.8rem;
        border-radius: 10px;
    }

        /* hide left accent on mobile, rely on underline / color */
        .manage-nav .nav-link.active::before,
        .manage-nav .nav-link.text-primary::before {
            display: none;
        }
}
