@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
@import url('design-tokens.css');

body {
    background: var(--color-grey-primary);
    color: var(--text-light);
    font-family: "Inter", sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;       /* center content horizontally */
    padding: var(--page-padding);
    box-sizing: border-box;
}

/* Restrict main content width */
.container {
    width: 100%;
    max-width: var(--max-content-width);
    box-sizing: border-box;
}

/* Buttons */

.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

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

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

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

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

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

/* Cards */

.card {
    background: var(--color-grey-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-md);
}

/* Navigation */

nav {
    background: var(--color-grey-secondary);
    color: var(--text-light);
    padding: 1rem;
    display: flex;

    justify-content:
        space-between;
    align-items: center;
}

nav a {
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

nav a:hover {
    background: var(--color-accent-primary);
}

/* ===================================== */
/* Utility Classes */
/* ===================================== */

.u-flex {
    display: flex;
}

.u-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.u-grid {
    display: grid;
    gap: 1rem;
}

.u-m-1 {
    margin: 1rem;
}

.u-p-1 {
    padding: 1rem;
}

.u-rounded {
    border-radius: var(--radius-default);
}

.u-shadow {
    box-shadow: var(--shadow-md);
}

/* ===================================== */
/* UI Components */
/* ===================================== */

.input {
    padding: 0.7rem 1rem;
    background: var(--color-grey-secondary);
    color: var(--text-light);
    border: none;
    border-radius: var(--radius-md);
    width: 100%;
}

.input:focus {
    outline: 2px solid var(--color-accent-primary);
}

.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.alert-blue {
    background: var(--color-blue);
    color: var(--text-light);
}

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

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

.alert-red {
    background: var(--color-red);
    color: var(--text-light);
}

.tag {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

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

/* ===================================== */
/* Palette Preview */
/* ===================================== */

.palette-preview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.palette-item {
    height: 80px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-light);
}

.palette-grey-primary {
    background: #2E3347;
}

.palette-grey-secondary {
    background: #3C4256;
}

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

.palette-accent-bright {
    background: #EFCCB2;
    color: #1A1A1A;
}

.palette-accent-dark {
    background: #3D1900;
}

.palette-blue {
    background: #4D5E85;
}

.palette-green {
    background: #5F7F68;
    color: #1A1A1A;
}

.palette-yellow {
    background: #C9A53A;
    color: #1A1A1A;
}

.palette-red {
    background: #7A2E2E;
}

/* ===================================== */
/* Responsive Grid System */
/* ===================================== */
.grid {
    display: grid;
    gap: var(--space-3);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* ===================================== */
/* Typography Scale */
/* ===================================== */

.h1 {
    font-size: var(--font-3xl);
    font-weight: 700;
}

.h2 {
    font-size: var(--font-2xl);
    font-weight: 700;
}

.h3 {
    font-size: var(--font-xl);
    font-weight: 600;
}

.p {
    font-size: var(--font-base);
}

/* ====== FLAGS ====== */
.flag-small {
  width: 40px;
  height: auto;
  vertical-align: middle;
}

/* ===================================== */
/* Shadows */
/* ===================================== */
.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

/* ===================================== */
/* Borders */
/* ===================================== */
.border {
    border: 1px solid var(--color-grey-secondary);
}

.border-accent {
    border: 2px solid var(--color-accent-primary);
}

.rounded-sm {
    border-radius: var(--radius-sm);
}

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

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

/* ===================================== */
/* Spacing System */
/* ===================================== */

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

.m-2 {
    margin: var(--space-2);
}

.m-3 {
    margin: var(--space-3);
}

.p-1 {
    padding: var(--space-1);
}

.p-2 {
    padding: var(--space-2);
}

.p-3 {
    padding: var(--space-3);
}

/* ===================================== */
/* Button Variants */
/* ===================================== */
.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
}

.btn-soft {
    background: rgba(255, 255, 255, 0.1);
}

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

/* ===================================== */
/* Card Variations */
/* ===================================== */
.card-flat {
    box-shadow: none;
}

.card-bordered {
    border: 1px solid var(--color-grey-secondary);
}

.card-accent {
    border-left: 6px solid var(--color-accent-primary);
}

/* ===================================== */
/* Form Layouts */
/* ===================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

/* === Header & Navbar Base === */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background-color: var(--color-grey-primary); /* Adjust to your theme */
    color: var(--color-accent-primary);
    z-index: 1000;
}

header .logo {
    font-size: 1.5rem;
    font-weight: bold;
}

/* === Main Menu Horizontal === */
.navbar ul.menu {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* === Dropdown Parent === */
.navbar ul.menu li.dropdown {
    position: relative;
}

/* === Dropdown Menu === */
.navbar ul.menu li .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--color-grey-primary);
    color: var(--color-accent-bright);
    min-width: 180px;
    list-style: none;
    padding: 0;
    margin: 0;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

/* === Show Dropdown on Hover === */
.navbar ul.menu li.dropdown:hover > .dropdown-menu {
    display: block;
}

/* === Dropdown Item Styling === */
.navbar ul.menu li .dropdown-menu li a {
    display: block;
    padding: 10px 16px;
    white-space: nowrap;
    color: var(--text-light);
    text-decoration: none;
}

.navbar ul.menu li .dropdown-menu li a:hover {
    background-color: var(--color-grey-secondary);
}

/* === Top-Level Links === */
.navbar ul.menu > li > a {
    color: var(--text-light);
    text-decoration: none;
    padding: 12px 16px;
    display: inline-block;
}

.navbar a,
.navbar a:link,
.navbar a:visited,
.navbar a:hover,
.navbar a:active {
    color: var(--color-accent-primary);  /* your accent color */
    text-decoration: none;
}

/* === Language Switch & Theme Toggle Styling === */
.navbar ul.menu li.lang-switch img.flag-small {
    width: 24px;
    height: auto;
}

.navbar ul.menu li .theme-toggle {
    cursor: pointer;
    padding: 8px;
    font-size: 1.2rem;
}

/* Optional: prevent text selection on toggle */
.navbar ul.menu li .theme-toggle::selection {
    background: none;
}

/* Uniform accent color for all link states */
a:link,
a:visited,
a:hover,
a:active {
    color: var(--color-accent-primary); /* Replace with your accent color */
    text-decoration: none; /* optional: remove underline */
}

/* === Hamburger Menu === */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-accent-primary);
    transition: var(--transition-normal);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

@media (max-width: 768px) {
    :root {
        --page-padding: 16px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Show hamburger, hide desktop nav */
    .hamburger {
        display: flex;
    }

    .navbar ul.menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--color-grey-primary);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 24px;
        z-index: 1000;
        padding: 0;
        margin: 0;
    }

    .navbar ul.menu.active {
        display: flex;
    }

    /* Make all nav items full-width with larger touch targets */
    .navbar ul.menu > li {
        width: 100%;
        text-align: center;
    }

    .navbar ul.menu > li > a {
        display: block;
        padding: 16px 24px;
        min-height: 44px;
        font-size: 1.2rem;
    }

    /* Dropdowns in mobile: show inline instead of position absolute */
    .navbar ul.menu li.dropdown .dropdown-menu {
        position: static;
        display: none;
        background-color: var(--color-grey-secondary);
        box-shadow: none;
        width: 100%;
        margin-top: 8px;
    }

    .navbar ul.menu li.dropdown.active .dropdown-menu {
        display: block;
    }

    header {
        position: relative;
    }

    /* Stack form labels above inputs on mobile */
    .contact-form .form-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .contact-form label {
        width: 100%;
        text-align: left;
    }

    .contact-form button {
        width: 100%;
    }
}

/* === Contact Form === */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* Table-like form rows */
.contact-form .form-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Label styling */
.contact-form label {
    width: 120px;           /* fixed width for alignment */
    text-align: left;
    font-weight: 500;
}

/* Input & textarea styling */
.contact-form input,
.contact-form textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--color-grey-secondary);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: var(--color-grey-secondary);
    color: var(--text-light);
}

/* Button styling */
.contact-form button {
    padding: 10px 20px;
    background-color: var(--color-accent-primary);
    border: none;
    color: var(--text-light);
    font-size: 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.contact-form button:hover {
    background-color: var(--color-accent-hover); /* slightly darker on hover */
}

/* Optional: make textarea taller */
.contact-form textarea {
    min-height: 120px;
}
