/* ============================== Fonts ============================== */

@font-face { /* Normal Roboto */
    font-family: "Roboto Slab";
    src: url("../fonts/roboto-slab-v36-latin-regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face { /* Bold Roboto */
    font-family: "Roboto Slab";
    src: url("../fonts/roboto-slab-v36-latin-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face { /* Italic Garamond */
    font-family: "Garamond Premier Pro";
    src: url("../fonts/GaramondPremrPro-It.woff2") format("woff2");
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

@font-face { /* Normal Garamond */
    font-family: "Garamond Premier Pro";
    src: url("../fonts/GaramondPremrPro.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face { /* Medium Garamond */
    font-family: "Garamond Premier Pro";
    src: url("../fonts/GaramondPremrPro-Med.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face { /* Italic Medium Garamond */
    font-family: "Garamond Premier Pro";
    src: url("../fonts/GaramondPremrPro-MedIt.woff2") format("woff2");
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}

@font-face { /* Bold Garamond */
    font-family: "Garamond Premier Pro";
    src: url("../fonts/GaramondPremrPro-Bd.woff2") format("woff2");
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face { /* Italic Bold Garamond */
    font-family: "Garamond Premier Pro";
    src: url("../fonts/GaramondPremrPro-BdIt.woff2") format("woff2");
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}

/* ============================== Global Layouts ============================== */

:root {
    /* -------- Colors -------- */
    --primary-blue: #96d3d4;
    --primary-blue-muted: #7fafb0;
    --primary-blue-dark: #376a6b;
    --primary-blue-light: #e4f7f7;
    --primary-green: #d1fae5;
    --primary-green-dark: #065f46;
    --primary-green-light: #eafae1;
    --primary-white: #f8f8ff;
    --primary-white-dark: #f0f0f7;
    --secondary-white: #ffffff;
    --primary-gray: #edf2f7;
    --primary-gray-dark: #bfc2c7;
    --secondary-gray: #c5d2e3;
    --primary-red: #e53e3e;
    --primary-red-light: #fff5f5;
    --primary-red-muted: #ebc5c5;
    --primary-red-dark: #9b2c2c;
    --secondary-red-light: #fae6e6;
    --primary-yellow-light: #f7dc9c;
    --primary: #77d2d4;
    --border: #e8f2fa;

    /* -------- Text -------- */
    --font-main: "Roboto Slab", Georgia, serif;
    --font-secondary: "Garamond Premier Pro", Georgia, serif;
    --text-dark: #000000;
    --text-muted: #718096;
    --text-normal: #2d3748;
    --text-danger: #e53e3e;
    --text-danger-dark: #912a2a;
    --text-success: #28a745;
    --text-success-dark: #276749;
    --text-warning: #faa648;
    --text-warning-dark: #975a16;

    /* -------- Background -------- */
    --bg-color: #cbede8;
    --bg-light: #ffffff;
    --navbar-height: 6vh;
    --footer-height: 8vh;
    --decor-vine-w: 300px;
    --decor-bunch-w: 260px;
    --decor-opacity: 0.5;
    --decor-color: #093621;
}

body {
    font-family: var(--font-main);
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--text-normal);
    background-color: var(--bg-color);
}

/* ================ Page Decor ================ */

.pageDecor span {
    position: fixed;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    opacity: var(--decor-opacity);
    pointer-events: none;
    z-index: 0;
}

@media (max-width: 1600px) { :root { --decor-vine-w: 240px; --decor-bunch-w: 200px; } }
@media (max-width: 1300px) { :root { --decor-vine-w: 180px; --decor-bunch-w: 150px; --decor-opacity: 0.3; } }
@media (max-width: 1000px) { :root { --decor-vine-w: 130px; --decor-opacity: 0.25; }
                             .decorBunch { display: none; } }
@media (max-width: 640px)  { :root { --decor-vine-w: 90px;  --decor-opacity: 0.2; } }

/* --------------- Bottom Vines --------------- */

.decorVine {
    bottom: var(--footer-height);
    width: var(--decor-vine-w);
    aspect-ratio: 530 / 850;
    background-image: url("../images/vineBottom.svg");
    color: var(--decor-color);
}
.decorVineLeft  { left: -70px;  transform: scaleX(-1); }
.decorVineRight { right: -70px; }

/* --------------- Top Vines --------------- */

.decorBunch {
    top: var(--navbar-height);
    width: var(--decor-bunch-w);
    aspect-ratio: 350 / 300;
    background-image: url("../images/vineTop.svg");
}
.decorBunchLeft  { left: -53px;  transform: scaleX(-1); }
.decorBunchRight { right: -53px; }

/* --------------- Other Layout Elements --------------- */

h1 {
    margin-bottom: 30px;
    font-size: 1.85rem;
}

.main-dashboard-wrapper {
    padding: 30px 40px !important;
    max-width: 1500px;
    width: 100%;
    margin: var(--navbar-height) auto 0 auto;
    box-sizing: border-box;
    z-index: 1;
    position: relative;
    overflow: visible !important;
}

.site-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 32px;
    height: var(--footer-height);
    padding: 0 40px;
    background-color: var(--secondary-white);
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.basic-section {
    background-color: var(--secondary-white);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border);
    width: fit-content;
}

.wide-section {
    background-color: var(--secondary-white);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
}

.bg-section {
    background-color: var(--bg-color);
}

.table-wrapper{
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.meta-text {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-style: italic;
    font-size: .9rem;
}

.break {
  flex-basis: 100%;
  height: 0;
}

/* ============================== Top Navigation Bar ============================== */

.main-top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-height);
    background-color: var(--secondary-white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    z-index: 5000;
    overflow: visible !important;
    box-sizing: border-box;
}

.navbar-container {
    max-width: 1500px;
    height: 100%;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: visible;
    gap: 12px;
}

.navbar-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-normal);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 15px;
    height: 100%;
    flex: 0 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    -ms-overflow-style: none;
}

.navbar-links::-webkit-scrollbar {
    display: none;
}

.nav-item-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--text-normal);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 5px;
    transition: all 0.2s ease-in-out;
    text-wrap: nowrap;
    flex: 0 0 auto;
}

.nav-item-link:hover {
    background-color: var(--primary-blue-light);
    color: var(--primary-blue-dark);
}

.nav-item-link.active {
    background-color: var(--primary-blue-light);
    color: var(--primary-blue-dark);
}

.navbar-utilities {
    display: flex;
    align-items: center;
}

.navbar-brand, .navbar-utilities {
    flex: 0 0 auto;
}

@media (max-width: 1100px) {
    .navbar-links {
        --nav-fade: 24px;
        mask-image: linear-gradient(
            to right,
            transparent 0,
            #000 var(--nav-fade),
            #000 calc(100% - var(--nav-fade)),
            transparent 100%
        );
    }
}

/* ============================== Account Panel Dropdown ============================== */

.nav-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.nav-dropdown-trigger {
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-secondary);
    text-transform: uppercase;
    background-color: var(--primary-gray);
    color: var(--text-normal);
    padding: 6px 14px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s, color 0.2s;
}

.nav-dropdown-trigger:hover, .nav-dropdown-trigger:focus {
    background-color: var(--primary-blue-light);
    color: var(--text-muted);
}

.dropdown-arrow {
    font-size: 0.65rem;
    color: var(--primary-gray-dark);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background-color: var(--secondary-white);
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 6px 0;
    z-index: 6000 !important;
    overflow: visible;
}

#profileDropdownWrapper.open .nav-dropdown-menu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.dropdown-header {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-family: var(--font-secondary);
    color: var(--text-muted);
}

.dropdown-divider {
    border: 0;
    height: 2px;
    background: var(--primary-gray);
    margin: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-normal);
    text-decoration: none;
    font-family: var(--font-secondary);
    font-size: 0.85rem;
    font-weight: bold;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
}

.dropdown-item:hover {
    background-color: var(--primary-white);
    color: var(--text-dark);
}

.dropdown-item.text-danger {
    color: var(--text-danger);
}

.dropdown-item.text-danger:hover {
    background-color: var(--primary-red-light);
    color: var(--text-danger);
}

.alert-badge-count {
    background-color: var(--primary-red);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.logout-form-wrapper {
    margin: 0;
    padding: 0;
    width: 100%;
}


/* ============================== Buttons ============================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    color: var(--text-muted);
}

.btn {
    padding: 8px 10px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.85em;
    text-decoration: none;
    display: inline-flex;
    font-family: var(--font-secondary);
    line-height: 1;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn[hidden] {
    display: none;
}

.btn:hover {
    opacity: 0.9;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 5px;
    transition: all 0.2s ease-in-out;
}

.btn-link:hover {
    color: var(--primary-blue-dark);
    background-color: var(--primary-blue-light);
}

.btn-link:active {
    background-color: var(--primary-blue-light);
    color: var(--primary-blue-muted);
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--text-normal);
    border-color: var(--primary-blue-muted);
}

.btn-primary:hover {
    background-color: var(--primary-blue-light);
}

.btn-secondary {
    background-color: var(--primary-white);
    color: var(--text-normal);
    border-color: var(--border);
}

.btn-secondary:hover {
    background-color: var(--primary-white-dark);
}

.btn-secondary:active, .btn-secondary.is-active {
    background: var(--primary-blue);
    color: var(--primary-blue-dark);
}

.btn-danger {
    background-color: var(--primary-red-light);
    color: var(--primary-red);
    border-color: var(--primary-red-muted);
}

.btn-danger:hover {
    background-color: var(--primary-red-muted);
}

.btn.text-danger { /* Add onto an 'btn' to make the text danger-colored, can be used alongside other btn styling */
    color: var(--text-danger);
}

.btn.text-danger:hover {
    background-color: var(--primary-red-light);
    color: var(--text-danger);
}

.btn-block {
    display: block;
    width: 100%;
    margin: 10px 0;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-wide {
    flex: 2;
}

.btn-text {
    cursor: pointer;
    color: inherit;
    font-weight: inherit;
    font-size: inherit;
    font-family: inherit;
    border: none;
    background-color: transparent;
    font-style: inherit;
    text-decoration: none;
}

.btn-text:hover {
    color: var(--primary);
}

.btn-small {
    padding: 4px 12px;
    font-size: 0.85rem;
    width: fit-content;
}

.inline-form {
    display: inline;
    margin: 0;
}

/* ============================== Alerts ============================== */

.alert {
    padding: 12px 16px;
    border: 2px solid var(--secondary-white);
    border-radius: 20px;
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.alert-success { background: #c6f6d5; color: #276749; }
.alert-error, .alert-danger { background: #fed7d7; color: #9b2c2c; }
.alert-warning { background: #fefcbf; color: #975a16; }
.alert-info, .alert-debug { background: #bee3f8; color: #2c5282; }

/* ============================== Status Pills ============================== */

.status-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    border: 1px solid transparent;
    background: var(--primary-white);
}

.status-active {
    background: var(--primary-green);
    color: var(--primary-green-dark);
    border-color: var(--primary-green-dark);
}

.status-inactive {
    background: var(--primary-red-light);
    color: var(--primary-red);
    border-color: var(--primary-red-dark);
}

/* ============================== TomSelect ============================== */

.ts-dropdown .active {
    background-color: var(--primary-blue) !important;
    color: white !important;
    z-index: 2000 !important;
}