/* ==============================================
   Clientarea Home — Custom UI Enhancements
   Extends the existing Landrick design system
   ============================================== */

/* -----------------------------------------------
   Page-level spacing & background
   ----------------------------------------------- */
.page-content.bg-light {
    background-color: #f4f6fb !important;
    /* 71px sabit header + 40px nefes alanı */
    padding-top: 111px;
    padding-bottom: 64px;
    min-height: 100vh;
    display: flex;
}

/* col-xl-11'i container içinde ortala */
.page-content.bg-light .container > .col-xl-11 {
    margin-left: auto;
    margin-right: auto;
}

/* -----------------------------------------------
   Rich Search bar (kart dışı)
   ----------------------------------------------- */
.rs-search-wrap {
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

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

.rs-search-icon {
    position: absolute;
    left: 15px;
    color: #8898aa;
    pointer-events: none;
    z-index: 1;
    -webkit-transition: color 0.2s ease;
    transition: color 0.2s ease;
}

.rs-search-inner:focus-within .rs-search-icon {
    color: #2f55d4;
}

.rs-search-input {
    width: 100%;
    height: 50px;
    padding: 0 18px 0 46px;
    font-family: "Nunito", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    background-color: rgba(255, 255, 255, 0.85);
    border: 1.5px solid #dde3f0;
    border-radius: 14px;
    outline: none;
    box-shadow: 0 2px 8px rgba(47, 85, 212, 0.06);
    -webkit-transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
}

.rs-search-input::placeholder {
    color: #a0aec0;
    font-weight: 500;
}

.rs-search-input:focus {
    background-color: #ffffff;
    border-color: #2f55d4;
    box-shadow: 0 0 0 3px rgba(47, 85, 212, 0.10), 0 2px 8px rgba(47, 85, 212, 0.08);
}

/* -----------------------------------------------
   Dropdown menu
   ----------------------------------------------- */
.rs-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1.5px solid #dde3f0;
    border-radius: 14px;
    box-shadow: 0 4px 6px rgba(60, 72, 88, 0.04), 0 12px 32px rgba(47, 85, 212, 0.10);
    overflow: hidden;
    z-index: 1050;
    display: none;
}

.rs-dropdown.open {
    display: block;
}

.rs-dropdown-title {
    padding: 10px 16px 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #a0aec0;
}

/* Single suggestion row */
.rs-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    -webkit-transition: background-color 0.15s ease;
    transition: background-color 0.15s ease;
    text-decoration: none;
}

.rs-item:hover,
.rs-item.rs-active {
    background-color: #f0f4ff;
}

/* Icon avatar */
.rs-sug-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background-color: #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2f55d4;
}

.rs-sug-icon svg {
    width: 18px;
    height: 18px;
}

/* Text content */
.rs-sug-body {
    flex: 1;
    min-width: 0;
}

.rs-sug-name {
    font-size: 13px;
    font-weight: 700;
    color: #161c2d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rs-sug-name mark {
    background: none;
    color: #2f55d4;
    font-weight: 800;
    padding: 0;
}

.rs-sug-meta {
    font-size: 11px;
    font-weight: 500;
    color: #8898aa;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status badge */
.rs-sug-status {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
}

.rs-sug-status.active {
    background-color: rgba(46, 202, 139, 0.12);
    color: #1aa96e;
}

.rs-sug-status.suspended {
    background-color: rgba(228, 63, 82, 0.10);
    color: #c0392b;
}

.rs-sug-status.pending {
    background-color: rgba(241, 116, 37, 0.10);
    color: #c86a10;
}

.rs-sug-status.cancelled {
    background-color: rgba(108, 117, 125, 0.10);
    color: #6c757d;
}

/* Empty state */
.rs-empty {
    padding: 20px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #a0aec0;
}

/* Footer */
.rs-footer {
    padding: 8px 16px 12px;
    border-top: 1px solid #f0f4ff;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #2f55d4;
    cursor: pointer;
    -webkit-transition: background-color 0.15s ease;
    transition: background-color 0.15s ease;
}

.rs-footer:hover {
    background-color: #f8f9ff;
}

/* -----------------------------------------------
   Outer card wrapper
   ----------------------------------------------- */
.page-content .card.rounded-5 {
    border: none;
    box-shadow: 0 1px 3px rgba(60, 72, 88, 0.06),
    0 8px 32px rgba(60, 72, 88, 0.10);
    background-color: #ffffff;
}

.page-content .card.rounded-5 .card-body {
    padding: 32px 24px !important;
}

/* -----------------------------------------------
   Module grid list
   ----------------------------------------------- */
ul.li_animate {
    row-gap: 12px !important;
    column-gap: 0;
}

/* -----------------------------------------------
   Individual module item
   ----------------------------------------------- */
.module-item {
    padding: 4px;
}

/* -----------------------------------------------
   Animated icon link wrapper
   ----------------------------------------------- */
.animated-icon {
    display: block;
    color: #3c4858;
    text-decoration: none !important;
    height: 100%;
    -webkit-transition: color 0.25s ease;
    transition: color 0.25s ease;
}

/* -----------------------------------------------
   Module box — the visual "tile"
   ----------------------------------------------- */
.module-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 12px 20px;
    min-height: 110px;
    background-color: #f8f9ff;
    border: 1.5px solid #e8ecf4;
    border-radius: 14px !important;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    -webkit-transition: background-color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
    transition: background-color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

/* Subtle inner glow on load */
.module-box::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: radial-gradient(circle at 50% 0%, rgba(47, 85, 212, 0.04) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    -webkit-transition: opacity 0.3s ease;
    transition: opacity 0.3s ease;
}

/* -----------------------------------------------
   Module SVG icon
   ----------------------------------------------- */
.module-box svg {
    color: #6b7c9a;
    flex-shrink: 0;
    -webkit-transition: color 0.25s ease,
    transform 0.30s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: color 0.25s ease,
    transform 0.30s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* -----------------------------------------------
   Module title label
   ----------------------------------------------- */
.module-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px;
    line-height: 1.3;
    color: #4a5568;
    -webkit-transition: color 0.25s ease;
    transition: color 0.25s ease;
}

/* -----------------------------------------------
   Hover states
   ----------------------------------------------- */
.animated-icon:hover .module-box,
.animated-icon:focus-visible .module-box {
    background-color: #eef2ff;
    border-color: rgba(47, 85, 212, 0.30);
    box-shadow: 0 4px 12px rgba(47, 85, 212, 0.10),
    0 1px 3px rgba(47, 85, 212, 0.08);
    transform: translateY(-3px);
}

.animated-icon:hover .module-box::before,
.animated-icon:focus-visible .module-box::before {
    opacity: 1;
}

.animated-icon:hover .module-box svg,
.animated-icon:focus-visible .module-box svg {
    color: #2f55d4;
    transform: scale(1.12) translateY(-1px);
}

.animated-icon:hover .module-title,
.animated-icon:focus-visible .module-title {
    color: #2f55d4;
}

/* Active / pressed state */
.animated-icon:active .module-box {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(47, 85, 212, 0.12);
}

/* -----------------------------------------------
   Entrance animation for list items
   ----------------------------------------------- */
@keyframes moduleReveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.li_animate .module-item {
    animation: moduleReveal 0.35s ease both;
}

.li_animate .module-item:nth-child(1) {
    animation-delay: 0.04s;
}

.li_animate .module-item:nth-child(2) {
    animation-delay: 0.08s;
}

.li_animate .module-item:nth-child(3) {
    animation-delay: 0.12s;
}

.li_animate .module-item:nth-child(4) {
    animation-delay: 0.16s;
}

.li_animate .module-item:nth-child(5) {
    animation-delay: 0.20s;
}

.li_animate .module-item:nth-child(6) {
    animation-delay: 0.24s;
}

.li_animate .module-item:nth-child(7) {
    animation-delay: 0.28s;
}

.li_animate .module-item:nth-child(8) {
    animation-delay: 0.32s;
}

.li_animate .module-item:nth-child(9) {
    animation-delay: 0.36s;
}

.li_animate .module-item:nth-child(10) {
    animation-delay: 0.40s;
}

.li_animate .module-item:nth-child(11) {
    animation-delay: 0.44s;
}

.li_animate .module-item:nth-child(12) {
    animation-delay: 0.48s;
}

.li_animate .module-item:nth-child(13) {
    animation-delay: 0.52s;
}

.li_animate .module-item:nth-child(14) {
    animation-delay: 0.56s;
}

/* -----------------------------------------------
   Responsive tweaks
   ----------------------------------------------- */
@media (max-width: 767px) {
    .page-content.bg-light {
        padding-top: 96px;
        padding-bottom: 40px;
        justify-content: flex-start;
    }

    .page-content .card.rounded-5 .card-body {
        padding: 20px 12px !important;
    }

    .module-box {
        min-height: 96px;
        padding: 18px 8px 14px;
    }

    .module-title {
        font-size: 11px !important;
    }
}

@media (max-width: 375px) {
    .module-box {
        padding: 14px 6px 12px;
        min-height: 86px;
    }
}


/* ============================================================
   Clientarea Left Sidebar
   ============================================================ */

/* --- Sidebar container --- */
.ca-sidebar {
    position: fixed;
    top: 86px; /* 70px sticky navbar + 16px gap */
    left: 16px;
    width: 240px;
    height: calc(100vh - 70px - 32px);
    background: #ffffff;
    border: 1px solid #edf0f7;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(22, 28, 45, 0.10);
    z-index: 998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-transition: -webkit-transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Content area offset when sidebar is open --- */
#caMainContent.ca-has-sidebar {
    margin-left: calc(240px + 32px);
    min-height: 100vh;
    -webkit-transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/*
 * Raw clientarea pages (invoices, details, products, etc.) have no .page-wrapper
 * of their own. We detect this via :has() and add top padding + horizontal
 * gutters so the content sits below the sticky navbar and within a readable width.
 */
#caMainContent.ca-has-sidebar:not(:has(> .page-wrapper)) {
    padding: 90px 32px 60px;
}

/*
 * For raw pages, also apply a max-width container so content isn't
 * stretched edge-to-edge on wide screens.
 */
#caMainContent.ca-has-sidebar:not(:has(> .page-wrapper)) > * {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Sidebar header (user profile) --- */
.ca-sidebar-header {
    padding: 18px 14px;
    border-bottom: 1px solid #edf0f7;
    flex-shrink: 0;
}

.ca-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ca-sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2f55d4 0%, #6c9bff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ca-sidebar-user-info {
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.ca-sidebar-user-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #161c2d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.ca-sidebar-user-email {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #8898aa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* --- Navigation area --- */
.ca-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0 8px;
}

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

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

.ca-sidebar-nav::-webkit-scrollbar-thumb {
    background: #dde3f0;
    border-radius: 4px;
}

/* --- Section labels --- */
.ca-nav-label {
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a0aec0;
    padding: 10px 14px 4px;
    margin: 0;
}

.ca-nav-label:first-child {
    padding-top: 4px;
}

/* --- Nav links --- */
.ca-nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    color: #4a5568 !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 0;
    -webkit-transition: background-color 0.18s ease, color 0.18s ease;
    transition: background-color 0.18s ease, color 0.18s ease;
    position: relative;
}

.ca-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: transparent;
    -webkit-transition: background-color 0.18s ease;
    transition: background-color 0.18s ease;
}

.ca-nav-link:hover {
    background-color: #f4f7ff;
    color: #2f55d4 !important;
}

.ca-nav-link:hover .ca-nav-icon-wrap {
    background-color: rgba(47, 85, 212, 0.10);
    color: #2f55d4;
}

.ca-nav-link.active {
    background-color: #eef2ff;
    color: #2f55d4 !important;
}

.ca-nav-link.active::before {
    background: #2f55d4;
}

.ca-nav-link.active .ca-nav-icon-wrap {
    background-color: rgba(47, 85, 212, 0.12);
    color: #2f55d4;
}

/* --- Nav icon wrapper --- */
.ca-nav-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background-color: #f0f4fb;
    color: #6b7c9a;
    flex-shrink: 0;
    font-size: 16px;
    -webkit-transition: background-color 0.18s ease, color 0.18s ease;
    transition: background-color 0.18s ease, color 0.18s ease;
}

/* --- Danger link (logout) --- */
.ca-nav-link-danger {
    color: #e43f52 !important;
}

.ca-nav-link-danger .ca-nav-icon-wrap {
    background-color: #fff0f1;
    color: #e43f52;
}

.ca-nav-link-danger:hover {
    background-color: #fff0f1;
    color: #c0392b !important;
}

.ca-nav-link-danger:hover .ca-nav-icon-wrap {
    background-color: rgba(228, 63, 82, 0.12);
    color: #c0392b;
}

/* --- Sidebar footer --- */
.ca-sidebar-footer {
    border-top: 1px solid #edf0f7;
    padding: 6px 0;
    flex-shrink: 0;
}

/* --- Mobile overlay --- */
.ca-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(22, 28, 45, 0.35);
    z-index: 997;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.ca-sidebar-overlay.active {
    display: block;
}

/* ---- Mobile toggle button ---- */
#caSidebarToggle {
    line-height: 1;
}

/* ============================================================
   Responsive: mobile sidebar as drawer
   ============================================================ */

@media (max-width: 991px) {
    /* Hide sidebar off-screen by default on mobile */
    .ca-sidebar {
        top: 70px;
        left: 0;
        height: calc(100vh - 70px);
        border-radius: 0;
        border: 0;
        border-right: 1px solid #edf0f7;
        -webkit-transform: translateX(-100%);
        transform: translateX(-100%);
        box-shadow: none;
    }

    /* Slide in when open */
    .ca-sidebar.ca-sidebar-open {
        -webkit-transform: translateX(0);
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(22, 28, 45, 0.15);
    }

    /* No margin shift on mobile */
    #caMainContent.ca-has-sidebar {
        margin-left: 0;
    }

    /* Raw pages on mobile: reduce side padding */
    #caMainContent.ca-has-sidebar:not(:has(> .page-wrapper)) {
        padding: 90px 16px 48px;
    }

    /* clientareahome page-content spacing fix on mobile */
    .page-content.bg-light {
        padding-top: 96px;
    }
}

/* ============================================================
   clientareahome.tpl — page-wrapper layout fix with sidebar
   ============================================================ */

/* Ensure clientareahome page-content fills available width */
.ca-page-wrapper {
    width: 100%;
}

.hidden {
    display: none !important;
}