/* =============================================
   FoodShare — Global Design System
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ------- CSS Custom Properties ------- */
:root {
    /* Palette */
    --clr-primary: #FF6B35;
    --clr-primary-dark: #E8541A;
    --clr-primary-light: #FF8C5A;
    --clr-accent: #2EC4B6;
    --clr-accent-dark: #1A9E92;
    --clr-success: #22C55E;
    --clr-warning: #F59E0B;
    --clr-danger: #EF4444;

    /* Neutrals */
    --clr-bg: #0F0F13;
    --clr-bg-2: #18181F;
    --clr-bg-3: #222230;
    --clr-surface: rgba(255, 255, 255, 0.05);
    --clr-surface-hover: rgba(255, 255, 255, 0.09);
    --clr-border: rgba(255, 255, 255, 0.10);
    --clr-border-hover: rgba(255, 255, 255, 0.22);

    /* Text */
    --clr-text: #F0F0F5;
    --clr-text-muted: #9999B0;
    --clr-text-dim: #55556A;

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #FF6B35 0%, #FF3CAC 100%);
    --grad-accent: linear-gradient(135deg, #2EC4B6 0%, #5B8CFF 100%);
    --grad-hero: linear-gradient(135deg, #0F0F13 0%, #1A0A2E 50%, #0F1F2E 100%);
    --grad-card: linear-gradient(145deg, rgba(255, 107, 53, 0.08) 0%, rgba(46, 196, 182, 0.04) 100%);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-9: 96px;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.40);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55);
    --shadow-glow-primary: 0 0 30px rgba(255, 107, 53, 0.25);
    --shadow-glow-accent: 0 0 30px rgba(46, 196, 182, 0.20);

    /* Transitions */
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ------- Reset & Base ------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--clr-bg);
    color: var(--clr-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ------- Typography ------- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--clr-text);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
}

h3 {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
}

p {
    color: var(--clr-text-muted);
    font-size: 1rem;
    line-height: 1.75;
}

.text-gradient {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* ------- Shared Navbar ------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 19, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--clr-border);
    padding: 0 var(--space-6);
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    gap: var(--space-5);
}

.navbar-brand {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    flex-shrink: 0;
}

.navbar-brand .brand-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.navbar-brand .brand-tagline {
    font-size: 0.65rem;
    color: var(--clr-text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.navbar-links a,
.navbar-links .nav-link {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--clr-text-muted);
    transition: color var(--transition), background var(--transition);
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font-body);
}

.navbar-links a:hover,
.navbar-links .nav-link:hover {
    color: var(--clr-text);
    background: var(--clr-surface);
}

.navbar-links a.active {
    color: var(--clr-primary);
    background: rgba(255, 107, 53, 0.1);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

/* ------- Buttons ------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    outline: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.50);
    filter: brightness(1.1);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--clr-border-hover);
    color: var(--clr-text);
}

.btn-outline:hover {
    border-color: var(--clr-primary);
    color: var(--clr-primary);
    background: rgba(255, 107, 53, 0.08);
    transform: translateY(-2px);
}

.btn-ghost {
    background: var(--clr-surface);
    color: var(--clr-text-muted);
    border: 1px solid var(--clr-border);
}

.btn-ghost:hover {
    background: var(--clr-surface-hover);
    color: var(--clr-text);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--clr-danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: translateY(-1px);
}

.btn-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--clr-success);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.btn-success:hover {
    background: rgba(34, 197, 94, 0.25);
    transform: translateY(-1px);
}

.btn-lg {
    padding: var(--space-4) var(--space-7);
    font-size: 1rem;
    border-radius: var(--radius-full);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: 0.82rem;
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

/* ------- Cards ------- */
.card {
    background: var(--grad-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--clr-surface);
    opacity: 0;
    transition: opacity var(--transition);
    border-radius: inherit;
}

.card:hover {
    border-color: var(--clr-border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.card:hover::before {
    opacity: 1;
}

/* ------- Badges ------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.badge-active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--clr-success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-accepted {
    background: rgba(91, 140, 255, 0.15);
    color: #5B8CFF;
    border: 1px solid rgba(91, 140, 255, 0.3);
}

.badge-expired {
    background: rgba(153, 153, 176, 0.15);
    color: var(--clr-text-muted);
    border: 1px solid rgba(153, 153, 176, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--clr-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ------- Form Elements ------- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--clr-text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--clr-surface);
    border: 1.5px solid var(--clr-border);
    border-radius: var(--radius-md);
    color: var(--clr-text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--clr-text-dim);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--clr-primary);
    background: rgba(255, 107, 53, 0.05);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239999B0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-select option {
    background: var(--clr-bg-2);
    color: var(--clr-text);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ------- Divider ------- */
.divider {
    height: 1px;
    background: var(--clr-border);
    margin: var(--space-6) 0;
}

/* ------- Shared Footer ------- */
.site-footer {
    background: var(--clr-bg-2);
    border-top: 1px solid var(--clr-border);
    padding: var(--space-8) var(--space-6) var(--space-5);
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-7);
    margin-bottom: var(--space-7);
}

.footer-brand .brand-name {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: var(--space-2);
}

.footer-brand p {
    font-size: 0.9rem;
    color: var(--clr-text-muted);
    max-width: 260px;
}

.footer-links-group {
    display: flex;
    gap: var(--space-8);
}

.footer-links-col h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--clr-text-muted);
    margin-bottom: var(--space-4);
}

.footer-links-col a {
    display: block;
    font-size: 0.9rem;
    color: var(--clr-text-muted);
    padding: 4px 0;
    transition: color var(--transition);
}

.footer-links-col a:hover {
    color: var(--clr-primary);
}

.footer-bottom {
    border-top: 1px solid var(--clr-border);
    padding-top: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--clr-text-dim);
}

/* ------- Modal ------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: var(--clr-bg-2);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-xl);
    padding: var(--space-7);
    max-width: 480px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    color: var(--clr-text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--clr-surface-hover);
    color: var(--clr-text);
}

/* ------- Section Container ------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    width: 100%;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-7);
}

.section-header .eyebrow {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--clr-primary);
    margin-bottom: var(--space-3);
}

.section-header h2 {
    margin-bottom: var(--space-3);
}

.section-header p {
    max-width: 560px;
    margin: 0 auto;
    font-size: 1.05rem;
}

/* ------- Grid ------- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
}

/* ------- Animations ------- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.6s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
}

/* ------- Empty State ------- */
.empty-state {
    text-align: center;
    padding: var(--space-9) var(--space-5);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
    opacity: 0.4;
}

.empty-state h3 {
    color: var(--clr-text-muted);
    margin-bottom: var(--space-3);
}

.empty-state p {
    color: var(--clr-text-dim);
    font-size: 0.9rem;
}

/* ------- Toast / Alert ------- */
.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86EFAC;
}

/* ------- Responsive ------- */
@media (max-width: 768px) {
    .navbar-links {
        display: none;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .footer-top {
        flex-direction: column;
    }

    .footer-links-group {
        flex-direction: column;
        gap: var(--space-5);
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}