@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Material Design 3 Palette */
    --primary: #2E8B85;
    --primary-container: #CEEBE8;
    --on-primary: #FFFFFF;
    --secondary: #F5A623;
    --secondary-container: #FFECC9;
    --tertiary: #4D626C;
    --surface: #F8FDFF;
    --surface-variant: #DBE4E6;
    --outline: #70797B;
    --error: #F44336;
    --success: #4CAF50;

    --bg-gradient: linear-gradient(135deg, #f0fdfa 0%, #e0f2f1 100%);
    --bg-dark: #1A1C1E;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 28px;
    --radius-xl: 32px;

    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--surface);
    color: #1A1C1E;
    min-height: 100vh;
    padding-bottom: 120px;
    /* Space for FABs and bottom nav */
}

a {
    color: inherit;
    text-decoration: none;
}

a:visited {
    color: inherit;
}

/* Glassmorphism utility */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.container {
    max-width: 600px;
    /* Keep it centered and bounded for that "app" look on desktop */
    margin: 0 auto;
    padding: 20px;
}

/* Typography */
h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

p {
    line-height: 1.6;
    color: #444;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--surface-variant);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-xl);
    flex-shrink: 0;
    /* Prevent buttons from squishing */
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    border: none;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white !important;
}

.btn-primary:hover {
    background: #25706b;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #e0971e;
}

.btn-fab {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    /* Forced circle for FAB */
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 100;
    aspect-ratio: 1/1;
    /* Modern way to maintain squareness before border-radius */
}

/* Specific class for circular small buttons */
.btn-circle {
    aspect-ratio: 1/1;
    border-radius: 50%;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Option menu items must behave the same whether they are links or buttons */
.menu-item {
    font-family: inherit;
}

button.menu-item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.menu-item:hover,
.menu-item:focus-visible {
    background: var(--surface-variant) !important;
}

/* Bottom Navigation (Mobile vibe) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--surface-variant);
    z-index: 1000;
    padding: 0 5px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--outline);
    transition: 0.3s;
    gap: 4px;
}

.nav-item i {
    font-size: 24px;
    padding: 4px 20px;
    border-radius: 20px;
    transition: 0.3s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    background: var(--primary-container);
    color: var(--primary);
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--outline);
    font-family: inherit;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-container);
}

/* Helper classes */
.flex {
    display: flex;
}

.flex-grow {
    flex-grow: 1;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 8px;
}

.w-full {
    width: 100%;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-8 {
    margin-top: 2rem;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.gap-5 {
    gap: 20px;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.flex-wrap {
    flex-wrap: wrap;
}

.text-sm {
    font-size: 0.8rem;
}

/* Fix for long names breaking layout */
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .card {
        padding: 16px;
    }

    /* Stack headers that would otherwise overflow */
    .mobile-stack {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    .mobile-stack>* {
        width: 100%;
    }

    .mobile-stack .flex {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--surface-variant);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.image-option {
    aspect-ratio: 1/1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: 0.2s;
    background: #f8f8f8;
}

.image-option:hover {
    border-color: var(--primary);
    transform: scale(1.02);
}

.image-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
