/*-------------------------------------------*\
 * CUSTOM CSS FRAMEWORK (MOBILE-FIRST)     *
\*-------------------------------------------*/

/* * 1. VARIABLES
 * Defines the core color palette and spacing units.
 */
:root {
    /* Color Palette */
    --color-primary: #6B8E23;
    /* Olive Drab */
    --color-secondary: #d8dcc9;
    /* Light Greenish-gray */
    --color-accent: #8BC34A;
    /* Light Green */
    --color-surface: #e6ead6;
    /* Very Light Green */
    --color-text-light: #FFFFFF;
    --color-text-med: #777;
    --color-text-dark: #333333;

    --shadow: rgba(0, 0, 0, 0.2);
    --shadow-b: rgba(255, 255, 255, 0.1);

    /* State Colors */
    --color-info: #2196F3;
    /* Blue */
    --color-success: #198754;
    /* Green */
    --color-danger: #dc3545;
    /* Red */

    /* Spacing & Sizing */
    --spacing-unit: 0.5rem;
    /* 8px if base font-size is 16px */
    --border-radius-sm: 5px;
    --border-radius-md: 10px;
    --border-radius-lg: 15px;

    /* Fonts */
    --font-primary: 'Ubuntu', sans-serif;
    --font-display: 'Lobster', cursive;
}

/* * 2. RESET & BASE STYLES
 * Sets sensible defaults for common HTML elements.
 * NOTE: These are now the mobile base styles.
 */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    height: fit-content;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-secondary);
    color: var(--color-text-dark);
    /* Mobile-first: Use smaller padding by default */
    padding: var(--spacing-unit);
    font-size: clamp(1rem, 1.25vw, 1rem);
    line-height: 1;
}

a {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: filter 0.2s ease;
    display: inline-block;
}

.hide {
    display: none;
}

a:visited {
    color: inherit;
    ;
}

a.hover:hover {
    filter: brightness(90%);
    background-color: var(--shadow);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-bottom: calc(var(--spacing-unit) * 2);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* * 3. LAYOUT UTILITIES
 * Classes for creating page layouts.
 */

/* NOTE: `mw-d` is a desktop-only utility, so it's moved to the media query. */
.bg-primary {
    background-color: var(--color-primary);
}

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

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

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

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

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

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

/* --- Text Colors --- */
.text-light {
    color: var(--color-text-light);
}

.text-dark {
    color: var(--color-text-dark);
}

.text-med {
    color: var(--color-text-med);
}

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

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

.text-accent {
    color: var(--color-accent);
}



.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 2);
}

.block {
    display: block;
}

.flex {
    display: flex;
}

.flex>.form-group {
    margin-bottom: 0;
}

.inline-grid {
    display: inline-grid;
}

.flex>div {
    flex: 1;
}

.flex-col-mobile {
    flex-direction: column;
    gap: 0;
}

.grid {
    display: grid;
}

.gap-1 {
    gap: var(--spacing-unit);
}

.gap-2 {
    gap: calc(var(--spacing-unit) * 2);
}

.gap-3 {
    gap: calc(var(--spacing-unit) * 3);
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.w-min {
    min-width: 2rem;
}

.w-fit {
    width: fit-content;
}

.w-full {
    width: 100%;
}

.w-half {
    width: 50%;
}

.w-third {
    width: 33.3333%;
}

.w-quarter {
    width: 25%;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-small,
.t-sm {
    font-size: small;
}


.t-md {
    font-size: medium;
}

.text-large,
.t-lg {
    font-size: large;
}

/* TEXT OVERFLOW CLASS */
.to {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.lowercase {
    text-transform: lowercase;
}

.uppercase {
    text-transform: uppercase;
}

i {
    margin: 1px;
}

/* * 4. COMPONENT STYLES
 * Styled components like buttons, cards, and forms.
 */

/* --- Buttons --- */

.btn {
    display: inline-block;
    padding: calc(var(--spacing-unit) * 2.5) calc(var(--spacing-unit) * 4);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border: none;
    /*border-radius: var(--border-radius-sm);*/
    cursor: pointer;
    transition: filter 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    height: auto;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-text-light);
}

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

.btn:hover {
    filter: brightness(110%);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-text-dark);
    border: 1px solid var(--color-primary);
}

/* --- Cards --- */
.card {
    background-color: var(--color-surface);
    /*     border-radius: var(--border-radius-lg);*/
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card a {
    min-width: 40px;
    text-align: center;
}

.card[id="loader"] {
    box-shadow: none;
}


/* TOOLTIP 
[data-title] {
    position: relative;
    cursor: pointer;
}
*/
[data-title]::after {
    content: attr(data-title);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 10;
}

[data-title]::before {
    content: '';
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 10;
}

/* --- Forms --- */
form>div:last-child .form-group {
    margin-bottom: 0;
}

.form-group {
    position: relative;
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.form-group>p {
    display: none;
}

.form-control {
    width: 100%;
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 1.5);
    font-size: 1rem;
    font-family: var(--font-primary);
    background-color: var(--color-secondary);
    border: none;
    /*  border-radius: var(--border-radius-sm);*/
    transition: box-shadow 0.2s ease;
}

.form-control:user-invalid {
    box-shadow: 0 0 0 2px var(--color-danger);
}

.form-group textarea.form-control:not(:placeholder-shown)+label,
.form-group textarea.form-control:focus+label {
    top: calc(var(--spacing-unit) * 1.25);
}

form .er {
    box-shadow: 0 0 0 2px var(--color-danger);
}

textarea {
    resize: none;
    display: block;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: none;
    padding: 0;
}

select::-ms-expand {
    display: none;
}

.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-info);
}

.form-group>label {
    position: absolute;
    left: calc(var(--spacing-unit) * 2);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: all 0.2s ease;
    color: #777;
}

.form-control:not(:placeholder-shown)+label,
.form-control:focus+label {
    top: calc(var(--spacing-unit) * 1.25);
    font-size: 0.8rem;
    transform: translateY(0);
}

/* --- Navbar --- */
/* NOTE: The navbar is styled for a mobile layout by default. */
.navbar {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    /*border-radius: var(--border-radius-sm);*/
    position: relative;
}

.navbar-brand {
    font-family: var(--font-display);
    font-size: 2rem;
}

.nav-links a {
    padding: calc(var(--spacing-unit) * 3);
    /*border-radius: var(--border-radius-sm);*/
    display: flex;
    text-align: center;
}


.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    filter: none;
}

/* --- Hamburger Menu Icon --- */
/* NOTE: The toggle is visible by default on mobile. */
.nav-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.nav-toggle .icon-bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-text-light);
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

.nav-links {
    /* NOTE: Links are hidden by default and shown with the toggle. */
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-primary);
    flex-direction: column;
    padding: var(--spacing-unit);
    border-bottom-left-radius: var(--border-radius-sm);
    border-bottom-right-radius: var(--border-radius-sm);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.is-open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.is-open>nav {
    display: block;
    z-index: 999;
    padding: calc(var(--spacing-unit) * 1.8);
}

/* --- Typography Additions --- */
blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: calc(var(--spacing-unit) * 3);
    margin: calc(var(--spacing-unit) * 3) 0;
    font-style: italic;
    color: #555;
}

pre {
    background-color: var(--color-secondary);
    padding: calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
}

/* --- Dialog/Modal --- */
dialog {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 0;
    width: 80%;
    max-width: 500px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--color-secondary);
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

.modal-header {
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
}

.modal-body {
    padding: calc(var(--spacing-unit) * 3);
}

.modal-footer {
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    text-align: right;
    background-color: var(--color-secondary);
    border-bottom-left-radius: var(--border-radius-lg);
    border-bottom-right-radius: var(--border-radius-lg);
}

/* --- Accordion --- */
.accordion-item {
    border-bottom: 1px solid var(--color-secondary);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-button {
    width: 100%;
    background-color: var(--color-surface);
    border: none;
    padding: calc(var(--spacing-unit) * 3);
    text-align: left;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.accordion-button:hover {
    background-color: var(--color-secondary);
}


.hl-1:hover {
    box-shadow: 0 0 0px 2px rgba(0, 0, 0, 0.10);
}

.hl-2:hover {
    box-shadow: 0 0 0px 2px rgba(0, 0, 0, 0.20);

}

.hl-3:hover {
    box-shadow: 0 0 0px 2px rgba(0, 0, 0, 0.30);

}

.link:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.accordion-button::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.accordion-button.is-open::after {
    transform: rotate(45deg);
}

.bold {
    font-weight: bold;
}

.accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    padding: 0 calc(var(--spacing-unit) * 3);
}

.accordion-panel.is-open {
    padding: calc(var(--spacing-unit) * 3);
}

.ui {
    max-width: 1100px;
    margin: 0 auto;
}

/* * 5. UTILITY CLASSES */
.p-05 {
    padding: calc(var(--spacing-unit) * .5);
}

.p-1 {
    padding: var(--spacing-unit) !important;
}

.p-2 {
    padding: calc(var(--spacing-unit) * 2);
}

.p-3 {
    padding: calc(var(--spacing-unit) * 3);
}

.p-4 {
    padding: calc(var(--spacing-unit) * 4);
}

.p-5 {
    padding: calc(var(--spacing-unit) * 5);
}

.p-a {
    padding: auto;
}

.pt-1 {
    padding-top: var(--spacing-unit) !important;
}

.pt-2 {
    padding-top: calc(var(--spacing-unit) * 2);
}

.pt-3 {
    padding-top: calc(var(--spacing-unit) * 3);
}

.pb-1 {
    padding-bottom: var(--spacing-unit);
}

.pb-2 {
    padding-bottom: calc(var(--spacing-unit) * 2);
}

.pb-3 {
    padding-bottom: calc(var(--spacing-unit) * 3);
}

.pl-1 {
    padding-left: var(--spacing-unit);
}

.pl-2 {
    padding-left: calc(var(--spacing-unit) * 2);
}

.pl-3 {
    padding-left: calc(var(--spacing-unit) * 3);
}

.pr-1 {
    padding-right: var(--spacing-unit);
}

.pr-2 {
    padding-right: calc(var(--spacing-unit) * 2);
}

.pr-3 {
    padding-right: calc(var(--spacing-unit) * 3);
}

.py-3 {
    padding-top: calc(var(--spacing-unit) * 3);
    padding-bottom: calc(var(--spacing-unit) * 3);
}



.m-1 {
    margin: var(--spacing-unit);
}

.mt-1 {
    margin-top: var(--spacing-unit) !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: var(--spacing-unit);
}

.ml-1 {
    margin-left: var(--spacing-unit);
}

.mr-1 {
    margin-right: var(--spacing-unit);
}

.m-2 {
    margin: calc(var(--spacing-unit) * 2);
}

.mt-2 {
    margin-top: calc(var(--spacing-unit) * 2) !important;
}

.mb-2 {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.ml-2 {
    margin-left: calc(var(--spacing-unit) * 2);
}

.mr-2 {
    margin-right: calc(var(--spacing-unit) * 2);
}

.m-3 {
    margin: calc(var(--spacing-unit) * 3);
}

.mt-3 {
    margin-top: calc(var(--spacing-unit) * 3) !important;
}

.mb-3 {
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.ml-3 {
    margin-left: calc(var(--spacing-unit) * 3);
}

.mr-3 {
    margin-right: calc(var(--spacing-unit) * 3);
}

.my-3 {
    margin-top: calc(var(--spacing-unit) * 3) !important;
    margin-bottom: calc(var(--spacing-unit) * 3) !important;
}

.mr-a {
    margin-right: auto !important;
}

.ml-a {
    margin-left: auto !important;
}

.mt-a {
    margin-top: auto !important;
}

.mb-a {
    margin-bottom: auto !important;
}

.ma {
    margin: auto;
}

.absolute {
    position: absolute;
}

.relative {
    position: relative;
}

.fixed {
    position: fixed;
}

/* --- Borders --- */
.rounded-sm,
.r-sm {
    border-radius: var(--border-radius-sm);
}

.rounded-md,
.r-md {
    border-radius: var(--border-radius-md);
}

.rounded-lg,
.r-lg {
    border-radius: var(--border-radius-lg);
}

.rounded-cir,
.r-cir {
    border-radius: 50%;
}

.visible>a[toggle] {
    background-color: rgba(255, 255, 255, 0.1);
}

.visible>a[toggle]>i:last-child {
    transform: rotate(90deg);
    transition: cubic-bezier(0.165, 0.84, 0.44, 1);
}

.visible :has(i[class="fa-caret-rigth"]) {
    transform: rotate(180deg);

}

.nav-links>div {
    display: none;
}

.visible>div {
    display: block
}

/* BORDER DASED */
.bb-l {
    border-bottom: 1px dashed var(--shadow);
}

.bt-l {
    border-top: 1px dashed var(--shadow);
}

.br-l {
    border-right: 1px dashed var(--shadow);
}

.bl-l {
    border-left: 1px dashed var(--shadow);
}

/* BORDER DOTTED */
.bb-d {
    border-bottom: 1px dotted var(--shadow);
}

.bt-d {
    border-top: 1px dotted var(--shadow);
}

.br-d {
    border-right: 1px dotted var(--shadow);
}

.bl-d {
    border-left: 1px dotted var(--shadow);
}

/* BORDER SOLID */
.bb-s {
    border-bottom: 1px solid var(--shadow);
}

.bt-s {
    border-top: 1px solid var(--shadow);
}

.br-s {
    border-right: 1px solid var(--shadow);
}

.bl-s {
    border-left: 1px solid var(--shadow);
}


/* * 6. RESPONSIVE DESIGN (MOBILE-FIRST)
 * Adjustments for larger screens.
 * The original max-width query is now min-width.
 */
@media (min-width: 768px) {

    /* --- General Layout Overrides --- */
    body {
        padding: calc(var(--spacing-unit) * 3);
    }

    .nav-links>div {
        position: absolute;
        right: 0;
        top: 107%;
        background: olivedrab;
        display: none;
        z-index: 9;
    }

    .visible>div {
        display: block;
        padding: calc(var(--spacing-unit) * 2);
    }

    .mw-d {
        max-width: 33%;
    }

    /* --- Desktop Navbar --- */
    /* NOTE: These styles override the mobile defaults. */
    .nav-toggle {
        display: none;
        /* Hide the hamburger menu */
    }

    .nav-links {
        display: flex;
        /* Show links horizontally */
        flex-direction: row;
        position: static;
        background-color: transparent;
        padding: 0;
        box-shadow: none;
    }





    .is-open {
        border-radius: var(--border-radius-md);
    }

    .flex-col-mobile {
        flex-direction: row;
        gap: calc(var(--spacing-unit) * 1);
    }

    /* --- Tooltip --- */
    [data-title]:hover::after,
    [data-title]:hover::before {
        opacity: 1;
        visibility: visible;
    }
}