/* ============================================
   BASE STYLES - Shared across all screens
   ============================================ */

/* Material Design 3 Color System */
:root {
    /* Custom Color Scheme */
    --md-sys-color-primary: #B90E2F;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #FFDAD6;
    --md-sys-color-on-primary-container: #410005;

    --md-sys-color-secondary: #B90E2F;
    --md-sys-color-on-secondary: #FFFFFF;
    --md-sys-color-secondary-container: #FFDAD6;
    --md-sys-color-on-secondary-container: #410005;

    --md-sys-color-background: #FBF7EF;
    --md-sys-color-on-background: #1C1B16;

    --md-sys-color-surface: #FBF7EF;
    --md-sys-color-on-surface: #1C1B16;
    --md-sys-color-surface-variant: #FBF7EF;
    --md-sys-color-on-surface-variant: #1C1B16;

    --md-sys-color-error: #BA1A1A;
    --md-sys-color-on-error: #FFFFFF;
    --md-sys-color-error-container: #FFDAD6;
    --md-sys-color-on-error-container: #410002;

    --md-sys-color-outline: #80766A;
    --md-sys-color-outline-variant: #D4C4B0;

    /* Elevation shadows (Material Design 3) */
    --md-sys-elevation-level0: none;
    --md-sys-elevation-level1: 0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-level2: 0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 2px 6px 2px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-level3: 0px 1px 3px 0px rgba(0, 0, 0, 0.3), 0px 4px 8px 3px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-level4: 0px 2px 3px 0px rgba(0, 0, 0, 0.3), 0px 6px 10px 4px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-level5: 0px 4px 4px 0px rgba(0, 0, 0, 0.3), 0px 8px 12px 6px rgba(0, 0, 0, 0.15);

    /* Spacing (Material Design 3) */
    --md-sys-spacing-1: 4px;
    --md-sys-spacing-2: 8px;
    --md-sys-spacing-3: 12px;
    --md-sys-spacing-4: 16px;
    --md-sys-spacing-5: 20px;
    --md-sys-spacing-6: 24px;
    --md-sys-spacing-8: 32px;

    /* Border radius (Material Design 3) */
    --md-sys-shape-corner-extra-small: 4px;
    --md-sys-shape-corner-small: 8px;
    --md-sys-shape-corner-medium: 12px;
    --md-sys-shape-corner-large: 16px;
    --md-sys-shape-corner-extra-large: 28px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden {
    display: none !important;
}

/* Material Design 3 Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 400;
    letter-spacing: 0;
}

h1 {
    font-size: 2.125rem;
    /* 34px */
    line-height: 2.5rem;
    /* 40px */
    font-weight: 400;
}

h2 {
    font-size: 1.75rem;
    /* 28px */
    line-height: 2.25rem;
    /* 36px */
    font-weight: 400;
}

/* Views */
.view {
    height: 100vh;
    /* Fallback */
    height: 100dvh;
    /* Mobile viewport support */
    width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent scrolling container */
    position: relative;
    background-color: var(--md-sys-color-background);
}

/* ============================================
   RESPONSIVE LAYOUT SYSTEM (M3)
   ============================================ */

/* Main View Container - Logic for NO SCROLL */
.view {
    height: 100vh;
    /* Fallback */
    height: 100dvh;
    /* Mobile viewport support */
    width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent scrolling container */
    position: relative;
    background-color: var(--md-sys-color-background);
}

/* ============================================
   LANDING & ONBOARDING SHARED STYLES
   ============================================ */

/* Top Section (White) */
.landing-top,
.onboarding-top {
    background-color: var(--md-sys-color-background);
    padding: clamp(16px, 4vh, 40px) clamp(20px, 5vw, 60px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex: 0 0 auto;
    /* Don't grow, size to content + padding */
    z-index: 10;
}

/* Typography - Scaling with Viewport */
.landing-title,
.onboarding-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 6vw + 1rem, 5rem);
    /* Scales from 32px to 80px */
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #000000;
    margin: 0;
}

.landing-subtitle,
.onboarding-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(2rem, 6vw + 1rem, 5rem);
    /* Scales from 32px to 80px */
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #000000;
    margin: 0;
}

.onboarding-question {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(1.75rem, 5vw, 4rem);
    /* Scales nicely */
    line-height: 1.1;
    color: var(--md-sys-color-background);
    margin: 0 0 clamp(20px, 4vh, 60px) 0;
    text-align: center;
    max-width: 90%;
}

/* Divider (The Wave) */
.wave-divider {
    width: 100%;
    /* Height scales relative to viewport width to maintain aspect ratio look, but capped */
    height: clamp(60px, 15vw, 200px);
    flex: 0 0 auto;
    line-height: 0;
    /* Remove gap */
    background-color: var(--md-sys-color-background);
    /* Match top bg */
    z-index: 5;
    margin-bottom: -1px;
    /* Fix sub-pixel rendering gaps */
}

.wave-divider svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Bottom Section (Red) */
.landing-bottom,
.onboarding-bottom {
    background-color: var(--md-sys-color-primary);
    flex: 1;
    /* Take remaining space */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Start from top of red section */
    padding: clamp(20px, 4vh, 60px) clamp(20px, 5vw, 40px);
    width: 100%;
    overflow: hidden;
    /* No scroll inside */
}

/* Inputs & Buttons Container scaling */
.onboarding-input,
.onboarding-btn-black,
.landing-btn {
    width: 100%;
    max-width: clamp(300px, 80vw, 600px);
    /* Responsive width constraint */
    height: clamp(48px, 8vh, 72px);
    /* Responsive height for touch targets */
    font-family: 'Inter', sans-serif;
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    border-radius: 36px;
    /* M3 pill shape */
    padding: 0 24px;
    margin-bottom: clamp(16px, 2.5vh, 32px);
    border: none;
    outline: none;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Specific Element Overrides */
.landing-btn {
    background-color: var(--md-sys-color-background);
    color: #000000;
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
    height: clamp(60px, 15vh, 120px);
    /* Larger for landing */
    font-weight: 400;
}

.onboarding-input {
    background-color: var(--md-sys-color-background);
    color: #1C1B16;
    box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.1);
}

.onboarding-input:focus {
    box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.onboarding-btn-black {
    background-color: #000000;
    color: var(--md-sys-color-background);
    cursor: pointer;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

.onboarding-btn-black:hover,
.landing-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.3);
}

.onboarding-btn-black:active,
.landing-btn:active {
    transform: translateY(0);
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Username & Year Groups */
.username-input-group {
    display: flex;
    flex-wrap: wrap;
    /* Wrap on tiny screens */
    gap: 12px;
    justify-content: center;
    width: 100%;
    max-width: 800px;
}

.username-prefix {
    background-color: var(--md-sys-color-background);
    border-radius: 36px;
    padding: 0 24px;
    height: clamp(48px, 8vh, 72px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    width: auto;
    min-width: 100px;
    flex: 0 1 auto;
}

.username-input {
    flex: 1 1 200px;
    /* Grow and shrink */
    margin-bottom: clamp(16px, 2.5vh, 32px);
    /* Match other inputs */
}

.year-buttons-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    width: 100%;
    max-width: 900px;
    margin-bottom: 24px;
    overflow-y: auto;
    /* Allow scroll ONLY for buttons if absolutely tiny screen */
    max-height: 40vh;
}

.year-btn {
    flex: 1 1 140px;
    /* Flex basis for wrapping */
    height: clamp(48px, 7vh, 64px);
    border-radius: 32px;
    background-color: var(--md-sys-color-background);
    color: #000000;
    border: none;
    font-size: clamp(1rem, 2vw, 1.5rem);
    cursor: pointer;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.year-btn.selected {
    background-color: #000000;
    color: #FFFFFF;
    transform: scale(1.05);
}

/* Links and Errors */
.onboarding-link-text {
    font-family: 'Inter', sans-serif;
    color: var(--md-sys-color-background);
    font-size: clamp(0.875rem, 1.5vw, 1.25rem);
    margin-top: auto;
    /* Push to bottom if space permits */
    padding-bottom: clamp(10px, 2vh, 20px);
}

.onboarding-link-btn {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    padding: 0 4px;
}

.onboarding-error {
    color: #FFDAD6;
    /* Lighter red for visibility on dark red */
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.onboarding-error:not(:empty) {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

/* Auth View - Material Design 3 Card (Legacy) */
.auth-container {
    max-width: 400px;
    margin: auto;
    padding: var(--md-sys-spacing-6);
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-level3);
    margin-top: var(--md-sys-spacing-8);
    margin-bottom: var(--md-sys-spacing-8);
}

.auth-container h1 {
    text-align: center;
    margin-bottom: var(--md-sys-spacing-6);
    color: var(--md-sys-color-on-surface);
    font-weight: 400;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-4);
}

/* Material Design 3 Filled Text Fields */
input[type="email"],
input[type="password"],
input[type="text"],
select,
textarea {
    width: 100%;
    padding: var(--md-sys-spacing-3) var(--md-sys-spacing-4);
    background-color: var(--md-sys-color-surface-variant);
    border: none;
    border-bottom: 2px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-extra-small) var(--md-sys-shape-corner-extra-small) 0 0;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
    color: var(--md-sys-color-on-surface);
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    background-color: var(--md-sys-color-surface-variant);
    border-bottom-color: var(--md-sys-color-primary);
    border-bottom-width: 2px;
}

input::placeholder,
textarea::placeholder {
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.6;
}

textarea {
    min-height: 120px;
    resize: vertical;
    border-radius: var(--md-sys-shape-corner-small);
    padding: var(--md-sys-spacing-4);
    border: 1px solid var(--md-sys-color-outline-variant);
}

textarea:focus {
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
}

select {
    background-color: var(--md-sys-color-surface-variant);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-small);
    padding: var(--md-sys-spacing-3) var(--md-sys-spacing-4);
    cursor: pointer;
}

select:focus {
    border-color: var(--md-sys-color-primary);
}

/* Material Design 3 Buttons */
.btn {
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-6);
    border: none;
    border-radius: var(--md-sys-shape-corner-extra-large);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 0.1px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    text-transform: uppercase;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
}

/* Filled Button (Primary) */
.btn-primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    box-shadow: var(--md-sys-elevation-level1);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: var(--md-sys-elevation-level2);
    background-color: #9B0B26;
}

.btn-primary:active:not(:disabled) {
    box-shadow: var(--md-sys-elevation-level1);
}

/* Outlined Button (Secondary) */
.btn-secondary {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    border: 1px solid var(--md-sys-color-outline);
    box-shadow: none;
}

.btn-secondary:hover:not(:disabled) {
    background-color: rgba(185, 14, 47, 0.08);
    border-color: var(--md-sys-color-primary);
}

/* Text Button */
.btn-text {
    background: transparent;
    color: var(--md-sys-color-primary);
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-3);
    text-transform: none;
    font-weight: 500;
    box-shadow: none;
}

.btn-text:hover:not(:disabled) {
    background-color: rgba(185, 14, 47, 0.08);
}

/* Icon Button */
.btn-icon {
    background: transparent;
    color: var(--md-sys-color-on-surface);
    padding: var(--md-sys-spacing-2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    text-transform: none;
}

.btn-icon:hover:not(:disabled) {
    background-color: rgba(28, 27, 22, 0.08);
}

/* Account Setup View */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--md-sys-spacing-6);
    background: var(--md-sys-color-background);
    min-height: 100vh;
}

.container header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--md-sys-spacing-6);
    padding-bottom: var(--md-sys-spacing-4);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.container h1 {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--md-sys-color-on-surface);
}

.setup-form {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-6);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-2);
}

.form-group label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
    letter-spacing: 0.1px;
}

/* ============================================
   FEED PAGE STYLES
   File: styles/feed.css (can be split)
   ============================================ */

/* Feed View - Figma Design */
#feed-view {
    background: #FBF7EF;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    height: 100vh;
    overflow: hidden;
}

/* Top Header with Feed/Events Navigation */
.feed-top-header {
    background: #FFFFFF;
    box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.25);
    padding: 10px 20px;
    width: 100%;
    flex: 0 0 auto;
    z-index: 10;
}

.feed-nav-container {
    display: flex;
    gap: 100px;
    align-items: center;
    justify-content: center;
}

.feed-nav-item {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
    padding: 10px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.feed-nav-item:hover {
    opacity: 0.8;
}

.feed-nav-icon-wrapper {
    background: #FBF7EF;
    border-radius: 20px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.feed-nav-icon-selected {
    background: #B90E2F;
    box-shadow: 0px 4px 4px 0px inset rgba(0, 0, 0, 0.25);
}

.feed-nav-icon {
    font-size: 56px;
    color: #000000;
}

.feed-nav-icon-selected .feed-nav-icon {
    color: #FFFFFF;
}

.feed-nav-label {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    line-height: normal;
    color: #000000;
    margin: 0;
    white-space: nowrap;
}

.feed-nav-selected .feed-nav-label {
    font-weight: 700;
}

/* Main Container: Toolbar and Feed */
.feed-main-container {
    display: flex;
    gap: 10px;
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    background: #FBF7EF;
}

/* Left Toolbar */
.feed-toolbar {
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    padding: 10px;
    flex: 0 0 auto;
    height: 100%;
}

.feed-toolbar-btn {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    padding: 10px;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 112px;
}

.feed-toolbar-btn:hover {
    opacity: 0.8;
}

.feed-toolbar-icon-wrapper {
    background: #FBF7EF;
    border-radius: 20px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    transform: scaleY(-1);
    position: relative;
}

.feed-toolbar-btn.selected .feed-toolbar-icon-wrapper {
    background: #B90E2F;
    box-shadow: 0px 4px 4px 0px inset rgba(0, 0, 0, 0.25);
}

.feed-toolbar-icon {
    font-size: 56px;
    color: #000000;
}

.feed-toolbar-btn.selected .feed-toolbar-icon {
    color: #FFFFFF;
}

.feed-toolbar-label {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 20px;
    line-height: normal;
    color: #000000;
    text-align: center;
    width: 100%;
    margin: 0;
}

/* Post Editor Container */
.post-editor-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    padding: 10px;
    flex: 0 0 auto;
    height: 100%;
}

.post-editor-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0px 0px 10px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 340px;
    flex: 1;
    min-height: 0;
}

.post-editor-username {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: normal;
    color: #B90E2F;
    margin: 0;
    white-space: nowrap;
}

.post-editor-textarea {
    font-family: 'Inter', sans-serif;
    font-weight: 100;
    font-size: 20px;
    line-height: normal;
    color: #000000;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 300px;
    padding: 5px;
    margin: 0;
    transition: font-weight 0.2s ease;
}

.post-editor-textarea:not(:placeholder-shown) {
    font-weight: 400;
}

.post-editor-textarea:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.post-editor-textarea:focus-visible {
    outline: none;
    border: none;
    box-shadow: none;
}

.post-editor-textarea::placeholder {
    color: #000000;
    opacity: 1;
    font-weight: 100;
}

.post-editor-actions {
    display: flex;
    gap: 33px;
    align-items: center;
    padding: 10px;
    width: 100%;
}

.post-editor-btn {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    padding: 10px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.post-editor-btn:hover {
    opacity: 0.8;
}

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

.post-editor-btn-icon-wrapper {
    background: #FBF7EF;
    border-radius: 20px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
}

.post-editor-btn-icon {
    font-size: 56px;
    color: #000000;
}

.post-editor-btn-label {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 20px;
    line-height: normal;
    color: #000000;
    text-align: center;
    width: min-content;
    margin: 0;
}

/* Feed Posts Container */
.feed-posts-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    padding: 10px 200px 10px 0;
    overflow-y: auto;
    min-height: 0;
    background: #FBF7EF;
    transition: padding 0.2s ease;
}

/* When post editor is hidden, restore normal padding */
.post-editor-container.hidden~.feed-posts-container {
    padding: 10px 200px 10px 250px;
}

/* Responsive Feed Padding */
@media (max-width: 1200px) {
    .post-editor-container.hidden~.feed-posts-container {
        padding: 10px 100px 10px 100px;
    }
}

@media (max-width: 768px) {
    .post-editor-container.hidden~.feed-posts-container {
        padding: 10px 20px;
    }
}

/* Posts List */
#posts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Post Cards - Figma Design */
.post-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0px 0px 10px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Post Footer - Date and Like Button H-Stack */
.post-footer {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 10px;
    gap: 10px;
}

.post-date {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: normal;
    color: #000000;
    text-align: right;
    margin: 0;
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.post-author {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: normal;
    color: #B90E2F;
    width: 100%;
    margin: 0;
}

.post-content {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: normal;
    color: #000000;
    white-space: pre-wrap;
    word-wrap: break-word;
    width: 100%;
    margin: 0;
}

/* Like Button - Figma Design */
.like-button {
    background: #FBF7EF;
    border: none;
    border-radius: 20px;
    padding: 10px;
    display: inline-flex;
    gap: 7px;
    align-items: center;
    justify-content: flex-end;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: normal;
    color: #000000;
    width: auto !important;
    height: auto;
    min-width: 0;
    max-width: none;
    flex-shrink: 0;
}

.like-button:hover {
    opacity: 0.8;
}

.like-button.liked {
    background: #B90E2F;
    color: #FBF7EF;
    justify-content: center;
    box-shadow: 0px 4px 4px 0px inset rgba(0, 0, 0, 0.25);
}

.like-count {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: normal;
    white-space: nowrap;
    flex-shrink: 0;
}

.like-button.liked .like-count {
    color: #FBF7EF;
}

.like-icon {
    font-size: 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    flex-shrink: 0;
}

.like-button.liked .like-icon {
    color: #FBF7EF;
}

.events-main-container {
    display: flex;
    gap: 10px;
    flex: 1;
    width: 100%;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    background: #FBF7EF;
}

.events-toolbar {
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    padding: 10px;
    flex: 0 0 auto;
    height: 100%;
    align-self: stretch;
}

.event-editor-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    padding: 10px;
    flex: 0 0 auto;
    height: 100%;
}

.event-editor-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0px 0px 10px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 360px;
}

.event-editor-username {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: normal;
    color: #B90E2F;
    margin: 0 0 10px 0;
}

.event-field-label {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #B90E2F;
    margin: 10px 0 0 0;
}

.event-input {
    background: transparent;
    border: none;
    border-radius: 20px;
    box-shadow: 0px 4px 4px 0px inset rgba(0, 0, 0, 0.15);
    padding: 10px 15px;
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    color: #000000;
    outline: none;
}

.event-textarea {
    min-height: 80px;
    resize: none;
}

.event-input::placeholder {
    color: #7F7F7F;
}

.event-editor-actions {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.event-editor-btn {
    background: #FBF7EF;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    display: inline-flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0px 4px 4px 0px inset rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.event-editor-btn span.material-icons {
    font-size: 24px;
}

.event-editor-btn-submit {
    background: #B90E2F;
    color: #FBF7EF;
}

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

.event-editor-btn-cancel {
    background: #FBF7EF;
    color: #000000;
}

.events-list-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 200px 10px 0;
    overflow-y: auto;
    min-height: 0;
    background: #FBF7EF;
}

/* Loading Indicator - Material Design Circular Progress */
.loading-indicator {
    display: flex;
    justify-content: center;
    padding: 20px;
    width: 100%;
}

.loading-indicator.hidden {
    display: none;
}

.md-circular-progress {
    display: inline-block;
    position: relative;
    width: 48px;
    height: 48px;
}

.md-circular-progress-spinner {
    animation: md-circular-progress-rotate 2s linear infinite;
    height: 100%;
    transform-origin: center center;
    width: 100%;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}

.md-circular-progress-circle {
    width: 36px;
    height: 36px;
    border: 4px solid #B90E2F;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes md-circular-progress-rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    width: 100%;
}

.events-empty-state {
    text-align: center;
    padding: var(--md-sys-spacing-8) var(--md-sys-spacing-6);
    color: var(--md-sys-color-on-surface-variant);
}

.event-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0px 0px 10px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.event-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #000000;
    margin: 0;
}

.event-description {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 20px;
    color: #000000;
    margin: 0;
}

.event-info-line {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    margin: 0;
    color: #000000;
}

.event-info-line span {
    font-weight: 700;
}

.event-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 20px;
    font-family: 'Inter', sans-serif;
}

.event-meta .event-posted {
    color: #000000;
}

.event-meta .event-host {
    color: #B90E2F;
    font-weight: 700;
}

.event-question {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 20px;
    text-align: center;
    margin: 10px 0;
}

.event-rsvp-box {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0px 4px 4px 0px inset rgba(0, 0, 0, 0.15);
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    position: relative;
}

.rsvp-button {
    background: #FBF7EF;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    display: inline-flex;
    gap: 7px;
    align-items: center;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    color: #000000;
    transition: all 0.2s ease;
}

.rsvp-button span.material-icons {
    font-size: 24px;
}

.rsvp-button.responded {
    background: #B90E2F;
    color: #FBF7EF;
    box-shadow: 0px 4px 4px 0px inset rgba(0, 0, 0, 0.25);
}

.rsvp-message {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    color: #000000;
    text-align: center;
}

.empty-state {
    text-align: center;
    padding: var(--md-sys-spacing-8) var(--md-sys-spacing-6);
    color: var(--md-sys-color-on-surface-variant);
}

.empty-state svg {
    margin-bottom: var(--md-sys-spacing-4);
    opacity: 0.6;
    color: var(--md-sys-color-on-surface-variant);
}

.empty-state h2 {
    font-size: 1.25rem;
    margin-bottom: var(--md-sys-spacing-2);
    color: var(--md-sys-color-on-surface);
    font-weight: 400;
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
}

/* ============================================
   MODAL STYLES
   File: styles/modal.css (can be split)
   ============================================ */

/* Material Design 3 Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--md-sys-spacing-4);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--md-sys-elevation-level5);
    overflow: hidden;
}

.modal-header {
    padding: var(--md-sys-spacing-6);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--md-sys-color-surface);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--md-sys-color-on-surface);
}

.modal-body {
    padding: var(--md-sys-spacing-6);
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: var(--md-sys-spacing-4) var(--md-sys-spacing-6);
    border-top: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    justify-content: flex-end;
    gap: var(--md-sys-spacing-2);
    background: var(--md-sys-color-surface);
}

/* Error Messages - Material Design 3 */
.error-message {
    color: var(--md-sys-color-on-error-container);
    background-color: var(--md-sys-color-error-container);
    font-size: 0.875rem;
    margin-top: var(--md-sys-spacing-2);
    padding: var(--md-sys-spacing-3) var(--md-sys-spacing-4);
    border-radius: var(--md-sys-shape-corner-small);
    display: none;
    border-left: 4px solid var(--md-sys-color-error);
}

.error-message:not(:empty) {
    display: block;
}

/* ============================================
   LOADING OVERLAY STYLES
   File: styles/loading.css (can be split)
   ============================================ */

/* Loading Overlay - Material Design 3 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(251, 247, 239, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}

/* Material Design 3 Circular Progress Indicator */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--md-sys-color-outline-variant);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {

    .auth-container,
    .container {
        padding: var(--md-sys-spacing-4);
        margin: var(--md-sys-spacing-4);
    }

    .feed-header {
        padding: var(--md-sys-spacing-3) var(--md-sys-spacing-4);
    }

    .feed-content {
        padding: var(--md-sys-spacing-4);
    }

    .post-card {
        padding: var(--md-sys-spacing-4);
    }

    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) 0 0;
    }
}

/* Material Design 3 Focus States */
.btn:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

/* Material Design 3 Ripple Effect (optional enhancement) */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-text::after,
.btn-icon::after {
    background: rgba(185, 14, 47, 0.1);
}

/* Material Icons */
.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* Additional Material Design 3 Enhancements */
.auth-container,
.post-card,
.modal-content {
    will-change: transform;
}

/* Smooth transitions for Material Design 3 */
* {
    transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}


/* ============================================
   POST REPLY SYSTEM (Figma)
   ============================================ */

/* Reply Button in Footer */
.reply-button {
    background: #FBF7EF;
    border-radius: 20px;
    padding: 10px;
    gap: 7px;
    display: flex;
    align-items: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    color: #000000;
}

.reply-button.active {
    background: #B90E2F;
    color: #FBF7EF;
    box-shadow: inset 0px 4px 4px rgba(0, 0, 0, 0.25);
}

.reply-count {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 20px;
}

.reply-icon {
    width: 24px;
    height: 24px;
}

/* Reply Input Section */
.reply-input-section {
    width: 100%;
    margin-top: 10px;
    display: none;
    /* Hidden by default */
    flex-direction: column;
    gap: 10px;
    animation: slideDown 0.3s ease-out;
}

.reply-input-section.visible {
    display: flex;
}

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

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

.reply-input-container {
    background: #FBF7EF;
    border-radius: 20px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reply-input-field {
    flex: 1;
    background: transparent;
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 20px;
    outline: none;
    color: #000000;
    min-height: 24px;
}

.reply-actions {
    display: flex;
    gap: 10px;
}

.reply-action-btn {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.reply-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);
}

.submit-reply-btn .material-icons {
    color: #4CAF50;
    font-size: 24px;
}

.close-reply-btn .material-icons {
    color: #B90E2F;
    font-size: 24px;
}

.reply-to-label {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #B90E2F;
    margin-right: 5px;
}

/* Replies List */
.replies-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding-left: 20px;
    /* Indent replies */
    border-left: 2px solid #FBF7EF;
}

.reply-card {
    background: #F8F8F8;
    border-radius: 15px;
    padding: 10px 15px;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.reply-author {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #B90E2F;
}

.reply-date {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #888;
}

.reply-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #000000;
    margin: 0;
}