/* CSS variable to manage viewport height with zoom */
:root {
    --bs-border-radius: 13px !important;
    --vh: 1vh;
    --full-vh: calc(var(--vh, 1vh) * 100);
}
[data-bs-theme="dark"] {
    --bs-body-bg: #0000002e !important;
    --bs-tertiary-bg: #0000002e;
    --bs-border-color: rgba(255, 255, 255, 0.151);
}
.nav-link i {
    margin-right: 10px;
}
.card {
    min-height: 50px;
}
.modal.show .modal-content {
    backdrop-filter: blur(105px);
}
body {
    min-height: 100dvh;
    min-height: var(--full-vh, 100vh);
    background-color: var(--color1);
    overflow: hidden;
    font-family: "Nunito", sans-serif;
}
.shop-profile-card {
    padding: 20px;
}
.card-header i {
    margin-right: 7px;
}
.card-header h2 {
    margin-bottom: 0;
}
.modal-header,
.modal-footer {
    padding: 15px 30px;
}
.modal-footer .btn {
    margin-top: 0;
}
.apex-zone-content {
    min-height: 50px;
}
.modal-body {
    max-height: 60vh;
    overflow-y: auto;
}
.list-group-item .row {
    flex: 1;
}
.modal {
    height: 100vh;
    overflow: hidden;
}
/* Top mode - allow scrolling on the body */
body.navbar-position-top {
    overflow-y: auto;
}
/* Disable body scroll when modal is open in navbar-top mode */
body.navbar-position-top.modal-open {
    overflow: hidden !important;
}
.font-lexend,
.modal-title,
.card-header h2,
.card-header h3,
.card-header .h3 {
    font-family: "Lexend", sans-serif;
}
.font-nunito {
    font-family: "Nunito", sans-serif;
}
a {
    text-decoration: none;
    color: var(--color5);
}
a:hover {
    color: var(--color6);
}

img {
    max-width: 100%;
    height: auto;
}

.text-color2 {
    color: var(--color2) !important;
}

/* Keep editor controls hidden for non-admin users even when editor.css is not loaded. */
body:not(.user-admin) .floating-edit-btn,
body:not(.user-admin) .apex-zone-overlay,
body:not(.user-admin) .apex-dynamic-zone-overlay,
body:not(.user-admin) .apex-dynamic-item-overlay,
body:not(.user-admin) .editor-panel {
    display: none !important;
}

/* App Background */
#app-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 0;
}

/* Top mode - fixed background that covers the entire viewport */
body.navbar-position-top #app-background {
    position: fixed;
    bottom: 0;
}

#app-background img {
    position: relative;
    width: 100vw;
    height: 100dvh;
    height: var(--full-vh, 100vh);
    object-fit: cover;
}

/* Top mode - the image covers the entire fixed viewport */
body.navbar-position-top #app-background img {
    height: 100%;
}

#app-background::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(
        0deg,
        var(--color1) 0%,
        var(--color1-50) 100%
    );
    z-index: 1;
}

/* App Container - Flexible Layout */
#app {
    color: var(--color2);
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100dvh;
    min-height: var(--full-vh, 100vh);
}

#app > header {
    flex-shrink: 0;
}

#app > .flex-grow-1 {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--editor-panel-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--editor-panel-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--editor-button-hover);
}
.card,
.breadcrumb,
.list-group {
    --bs-card-cap-bg: rgb(0 0 0 / 3%);
    border: 0;
    position: relative;
    background: linear-gradient(180deg, var(--color3) 0%, var(--color4) 100%);
    box-shadow: 0 11px 22px rgba(0, 0, 0, 0.38);
    color: var(--color2);
    border-radius: 11px;
}
.list-group {
    --bs-list-group-bg: transparent;
    --bs-list-group-border-width: 0;
    --bs-list-group-item-padding-y: 0.7rem;
    padding: 10px;
    border: 0;
}
.list-group-item {
    gap: 10px;
    display: flex;
    border-radius: 11px;
    transition: color 0.2s;
}
.list-group-item:hover {
    transition: color 0.2s;
}
.text-gradient1 {
    background: linear-gradient(180deg, var(--color2) 0%, var(--color6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.text-gradient2 {
    background: linear-gradient(270deg, var(--color5) 0%, var(--color6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.card:not(.card-notop)::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2.5px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    border-radius: 11px 11px 0 0;
    pointer-events: none;
}

/* App Content Container */
.app-content-container {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Main content area - grows to push footer down */
.app-main-content {
    flex: 1 0 auto;
}

/* Footer wrapper - shrinks and sticks to bottom */
.app-footer-wrapper {
    flex-shrink: 0;
    margin-top: auto;
}

/* =============================================
   TOP MODE - Layout with single scroll
   ============================================= */
body.navbar-position-top #app {
    display: block;
    min-height: auto;
    height: auto;
    flex-direction: column;
}

body.navbar-position-top .app-content-container {
    max-height: none;
    overflow: visible;
}

/* Adjust the background for top mode */
body.navbar-position-top #app-background img {
    height: auto;
    min-height: 100dvh;
    min-height: var(--full-vh, 100vh);
}

/* Attached top mode - full width without lateral padding on the navbar */
body.navbar-position-top.navbar-style-attached .app-content-container {
    padding-left: 20px;
    padding-right: 20px;
}

/* =============================================
   LEFT MODE - Layout with fixed sidebar (default)
   ============================================= */
body.navbar-position-left #app {
    display: flex;
    flex-direction: row;
}

body.navbar-position-left .app-content-container {
    padding-left: 0;
    max-height: 100dvh;
    max-height: var(--full-vh, 100vh);
    overflow-y: auto;
}

body.navbar-position-top.navbar-style-attached .app-content-top {
    padding-left: 20px;
    padding-right: 20px;
}

/* Detached top mode - standard padding */
body.navbar-position-top.navbar-style-detached .app-content-top {
    padding-left: 20px;
    padding-right: 20px;
}
.card .card-title {
    font-family: "Lexend", sans-serif !important;
}
.btn {
    border: 0;
    text-transform: uppercase;
    font-family: "Lexend", sans-serif;
    display: inline-flex;
    transform: scale(0.95);
    justify-content: center;
    align-items: center;
    font-weight: 800;
    border-radius: 13px;
    transition: transform 0.2s;
}
.btn:not(.input-group .btn) i {
    margin-right: 10px;
}
.btn:hover {
    transform: scale(1.05);
    transition: transform 0.2s;
}
.btn-primary,
.list-group-item.active {
    background-image: linear-gradient(
        270deg,
        var(--color5) 0%,
        var(--color6) 100%
    );
    color: var(--color2);
}
.progress-bar-striped {
    background-image: linear-gradient(
        45deg,
        var(--color6) 25%,
        transparent 25%,
        transparent 50%,
        var(--color6) 50%,
        var(--color6) 75%,
        transparent 75%,
        transparent
    );
    background-size: var(--bs-progress-height) var(--bs-progress-height);
}
.btn-secondary {
    background: var(--color2);
    color: var(--color1);
}
.btn-secondary:hover,
.btn-secondary:focus {
    background: var(--color2) !important;
    color: var(--color1) !important;
}
.opacity-70 {
    opacity: 0.7;
}
@media (min-width: 768px) {
    .col-md-7-5 {
        flex: 0 0 62.5%;
        max-width: 62.5%;
    }

    .col-md-4-5 {
        flex: 0 0 37.5%;
        max-width: 37.5%;
    }
}

.col-7-5 {
    flex: 0 0 62.5%;
    max-width: 62.5%;
}

.col-4-5 {
    flex: 0 0 37.5%;
    max-width: 37.5%;
}

/* Custom Dropdown Styles */
.custom-dropdown-toggle {
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
    position: relative;
}

.custom-dropdown-toggle:hover {
    opacity: 0.8;
}

.custom-dropdown-menu {
    position: fixed;
    border-radius: 11px;
    padding: 10px;
    min-width: 200px;
    max-width: 400px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;

    background: linear-gradient(180deg, var(--color3) 0%, var(--color4) 100%);
    box-shadow: 0 11px 22px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 0;
}

.custom-dropdown-menu::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2.5px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    border-radius: 11px 11px 0 0;
    pointer-events: none;
}

.custom-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.custom-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--color2);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
}

.custom-dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color2);
}

.custom-dropdown-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.custom-dropdown-header {
    padding: 12px 16px;
    color: var(--color2);
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    opacity: 0.7;
}

.custom-dropdown-item.text-center {
    justify-content: center;
    gap: 8px;
}

.custom-dropdown-item form {
    display: none;
}

/* Notifications dropdown specific styles */
.custom-dropdown-notifications {
    min-width: 320px;
    max-width: 400px;
}

.custom-notification-item {
    align-items: flex-start;
    gap: 12px;
}

.notification-icon {
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-date {
    font-size: 12px;
    color: var(--color2);
    opacity: 0.6;
    margin-bottom: 4px;
}

.notification-text {
    font-size: 13px;
    color: var(--color2);
    word-wrap: break-word;
}
.text-sm {
    font-size: 0.875rem;
}

/* ==============================================
   RESPONSIVE ZOOM WITH VIEWPORT COMPENSATION
   CSS zoom affects visual elements but not 
   viewport units (vh/vw). We adjust --vh to 
   compensate.
   ============================================== */

/* 1600px – large laptop screens */
@media (min-width: 1600px) {
    html {
        zoom: 1.15;
    }
    :root {
        /* 100vh / 1.15 = 86.96vh actual */
        --vh: 0.8696vh;
    }
}

/* 1920px – Full HD (reference) */
@media (min-width: 1920px) {
    html {
        zoom: 1.25;
    }
    :root {
        /* 100vh / 1.25 = 80vh actual */
        --vh: 0.8vh;
    }
}

/* 2560px – QHD */
@media (min-width: 2560px) {
    html {
        zoom: 1.4;
    }
    :root {
        /* 100vh / 1.4 = 71.43vh actual */
        --vh: 0.7143vh;
    }
}

/* 3200px+ – very large screens */
@media (min-width: 3200px) {
    html {
        zoom: 1.6;
    }
    :root {
        /* 100vh / 1.6 = 62.5vh actual */
        --vh: 0.625vh;
    }
}
.breadcrumb {
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(
        270deg,
        var(--color5-75) 0%,
        var(--color6-75) 100%
    );
}
.breadcrumb a {
    color: var(--color2);
}
.breadcrumb a:hover,
.breadcrumb li:last-child a {
    color: var(--color2);
    border-bottom: 1px solid;
    border-image: repeating-linear-gradient(
            to right,
            var(--color2) 0,
            var(--color2) 5px,
            transparent 5px,
            transparent 10px
        )
        1 stretch;
    border-image-slice: 1;
}
.breadcrumb-item + .breadcrumb-item::before {
    opacity: 0.5;
}

.breadcrumb::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 30%;
    height: 500%;
    transform: rotate(236deg) translateX(-20%) translateY(150%);
    background-image: linear-gradient(180deg, white 0%, #ffffff3b 100%);
    opacity: 0.2;
    z-index: 2;
}

/* Fix Bootstrap Modal backdrop blocking clicks and scroll */
.modal-backdrop {
    display: none !important;
}

.modal {
    z-index: 1050 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
}

.modal-dialog {
    position: relative;
    z-index: 1055 !important;
    pointer-events: auto !important;
}

.modal-content {
    position: relative;
    z-index: 1056 !important;
    pointer-events: auto !important;
}

.modal.show {
    overflow-y: auto !important;
}

body.modal-open {
    overflow: auto !important;
    padding-right: 0 !important;
}

/* ==============================================
   CUSTOM BOOTSTRAP TABLES - Apex Theme
   ============================================== */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--color2);
    --bs-table-border-color: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-striped-color: var(--color2);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.07);
    --bs-table-hover-color: var(--color2);
    --bs-table-active-bg: rgba(255, 255, 255, 0.1);
    --bs-table-active-color: var(--color2);
    color: var(--color2);
    border-collapse: separate;
    border-spacing: 0 4px;
}

/* Table wrapper - rounded borders consistent with cards */
.table-responsive {
    border-radius: 11px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px;
}

.card .table-responsive {
    border-radius: 0 0 11px 11px;
    background: transparent;
    padding: 6px;
}

/* Table header */
.table > thead > tr > th {
    background: rgba(255, 255, 255, 0.06);
    color: var(--color2);
    font-family: "Lexend", sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 18px;
    border: none;
    white-space: nowrap;
    opacity: 0.7;
}

.table > thead > tr > th:first-child {
    border-radius: 9px 0 0 9px;
}

.table > thead > tr > th:last-child {
    border-radius: 0 9px 9px 0;
}

/* Table body rows - white background low opacity rounded */
.table > tbody > tr {
    transition: all 0.2s ease;
}

.table > tbody > tr > td {
    padding: 13px 18px;
    border: none;
    vertical-align: middle;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    transition: background-color 0.2s ease;
}

.table > tbody > tr > td:first-child {
    border-radius: 9px 0 0 9px;
}

.table > tbody > tr > td:last-child {
    border-radius: 0 9px 9px 0;
}

/* Hover effect - subtle glow */
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
    background-color: rgba(255, 255, 255, 0.09);
}

/* Striped rows */
.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(255, 255, 255, 0.06);
}

.table-striped > tbody > tr:nth-of-type(even) > td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Bordered variant */
.table-bordered {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 11px;
    overflow: hidden;
}

.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td {
    border-color: rgba(255, 255, 255, 0.06);
}

/* Table inside a card */
.card > .table,
.card > .table-responsive > .table {
    margin-bottom: 0;
}

/* Table contextual variants - gaming style */
.table-primary,
.table > tbody > tr.table-primary > td {
    background: rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--color5);
    color: var(--color2);
}

.table-success,
.table > tbody > tr.table-success > td {
    background: rgba(40, 167, 69, 0.1);
    border-left: 3px solid #5dd67e;
    color: #5dd67e;
}

.table-danger,
.table > tbody > tr.table-danger > td {
    background: rgba(220, 53, 69, 0.1);
    border-left: 3px solid #e76e7a;
    color: #e76e7a;
}

.table-warning,
.table > tbody > tr.table-warning > td {
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #f0c84d;
    color: #f0c84d;
}

.table-info,
.table > tbody > tr.table-info > td {
    background: rgba(23, 162, 184, 0.1);
    border-left: 3px solid #5bc8d9;
    color: #5bc8d9;
}

/* Table contextual - round only the first td when there is a left border */
.table > tbody > tr.table-primary > td:first-child,
.table > tbody > tr.table-success > td:first-child,
.table > tbody > tr.table-danger > td:first-child,
.table > tbody > tr.table-warning > td:first-child,
.table > tbody > tr.table-info > td:first-child {
    border-radius: 9px 0 0 9px;
}

/* Small / compact table */
.table-sm > thead > tr > th {
    padding: 9px 14px;
    font-size: 0.7rem;
}

.table-sm > tbody > tr > td {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.table-sm {
    border-spacing: 0 3px;
}

/* Table with links */
.table a:not(.btn) {
    color: var(--color5);
    transition: color 0.2s;
}

.table a:not(.btn):hover {
    color: var(--color6);
}

/* Table badges */
.table .badge {
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Table buttons */
.table .btn {
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: 8px;
    text-transform: none;
    margin: 0 2px;
}

/* Table avatars / images */
.table img {
    border-radius: 8px;
}

/* Dark table override */
.table-dark {
    --bs-table-bg: rgba(0, 0, 0, 0.2);
    --bs-table-border-color: transparent;
    --bs-table-color: var(--color2);
}

.table-dark > tbody > tr > td {
    background: rgba(0, 0, 0, 0.15);
}

.table-dark > thead > tr > th {
    background: rgba(0, 0, 0, 0.25);
}

/* Pagination near tables */
.table + .pagination,
.table-responsive + .pagination {
    margin-top: 16px;
}
