/**
 * ============================================================================
 * UPPDRAG - uppdrag.snackaomhorsel.se
 * Submission & Feed Styles — Beautiful, Mobile-First
 * ============================================================================
 */

/* ==========================================================================
   CSS CUSTOM PROPERTIES
   ========================================================================== */

:root {
    --primary-blue: rgb(0, 93, 169);
    --dark-navy: rgb(20, 50, 95);
    --teal: rgb(70, 191, 208);
    --teal-rgb: 70, 191, 208;
    --dark-bg: rgb(15, 30, 55);
    --darker-bg: rgb(10, 22, 42);
    --text-light: rgb(255, 255, 255);
    --text-muted: rgba(255, 255, 255, 0.8);
    --text-subtle: rgba(255, 255, 255, 0.6);
    --coral: rgb(217, 59, 48);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.06);

    --color-error: #FF453A;
    --color-success: #32D74B;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --radius-2xl: 28px;
    --radius-full: 9999px;

    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

/* ==========================================================================
   BASE
   ========================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    background: var(--darker-bg);
    color: var(--text-light);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    overscroll-behavior-y: contain;
}

a { color: var(--teal); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: #5dd4e8; }

/* ==========================================================================
   PULL TO REFRESH
   ========================================================================== */

.pull-indicator {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(70, 191, 208, 0.15);
    border: 1px solid rgba(70, 191, 208, 0.3);
    border-radius: var(--radius-full);
    backdrop-filter: blur(20px);
    z-index: 100;
    transition: top 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.pull-indicator.visible {
    top: calc(var(--safe-top) + 12px);
    opacity: 1;
}

.pull-indicator.refreshing .pull-spinner {
    animation: spin 0.8s linear infinite;
}

.pull-spinner { width: 18px; height: 18px; color: var(--teal); }
.pull-text { font-size: 0.75rem; font-weight: 500; color: var(--teal); }

/* ==========================================================================
   AMBIENT BACKGROUND
   ========================================================================== */

.ambient-orbs {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0; overflow: hidden;
}

.ambient-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.25; will-change: transform; }

.ambient-orb:nth-child(1) {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(var(--teal-rgb), 0.18) 0%, transparent 70%);
    top: -200px; right: -200px;
    animation: floatOrb1 20s ease-in-out infinite;
}
.ambient-orb:nth-child(2) {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(0, 93, 169, 0.22) 0%, transparent 70%);
    bottom: -150px; left: -150px;
    animation: floatOrb2 25s ease-in-out infinite;
}
.ambient-orb:nth-child(3) {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(94, 92, 230, 0.12) 0%, transparent 70%);
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    animation: floatOrb3 18s ease-in-out infinite;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-50px, 30px) scale(1.05); }
    66% { transform: translate(30px, -20px) scale(0.95); }
}
@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.08); }
    66% { transform: translate(-20px, 40px) scale(0.92); }
}
@keyframes floatOrb3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
}

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
    position: relative; z-index: 1;
    min-height: 30vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem 1.5rem;
}

.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 18px;
    background: rgba(var(--teal-rgb), 0.08);
    border: 1px solid rgba(var(--teal-rgb), 0.25);
    border-radius: var(--radius-full);
    font-size: 0.7rem; font-weight: 600; letter-spacing: 2px;
    text-transform: uppercase; color: var(--teal);
    margin-bottom: 1.2rem;
    animation: fadeInUp 0.6s ease-out;
}

.pulse-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--teal);
    animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.7); }
}

.hero-title {
    font-size: clamp(2.8rem, 8vw, 5rem);
    font-weight: 800; line-height: 1.05; margin-bottom: 0.8rem;
    background: linear-gradient(135deg, #ffffff 30%, rgba(var(--teal-rgb), 0.9) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 2.5vw, 1.2rem);
    color: var(--text-subtle); font-weight: 400; letter-spacing: 0.5px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* ==========================================================================
   STATS BAR
   ========================================================================== */

.stats-bar {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: center; gap: 1.5rem;
    max-width: 420px; margin: 0 auto 0.5rem;
    padding: 1rem 2rem;
    background: rgba(var(--teal-rgb), 0.04);
    border: 1px solid rgba(var(--teal-rgb), 0.12);
    border-radius: var(--radius-full);
    backdrop-filter: blur(20px);
}

.stat-item { text-align: center; display: flex; flex-direction: column; gap: 0.15rem; }
.stat-number {
    font-size: 1.4rem; font-weight: 700; color: var(--teal);
    font-variant-numeric: tabular-nums;
    transition: transform 0.3s var(--transition-spring);
}
.stat-number.bump { transform: scale(1.2); }
.stat-label { font-size: 0.65rem; font-weight: 500; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-subtle); }
.stat-divider { width: 1px; height: 28px; background: rgba(255,255,255,0.08); }

.live-dot {
    font-size: 0.8rem !important;
    letter-spacing: 2px;
    position: relative;
}
.live-dot::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%; background: var(--color-success);
    margin-right: 6px;
    animation: pulseDot 1.5s ease-in-out infinite;
    vertical-align: middle;
}

/* ==========================================================================
   UPPDRAG TABS
   ========================================================================== */

.uppdrag-tabs {
    position: relative; z-index: 1;
    display: flex; gap: 0.5rem;
    max-width: 680px; margin: 1rem auto 0.5rem;
    padding: 0 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.uppdrag-tabs::-webkit-scrollbar { display: none; }

.uppdrag-tab {
    flex-shrink: 0;
    padding: 0.6rem 1.4rem;
    background: var(--glass);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-subtle);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    outline: none;
}
.uppdrag-tab:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}
.uppdrag-tab:hover {
    background: rgba(var(--teal-rgb), 0.06);
    border-color: rgba(var(--teal-rgb), 0.2);
    color: var(--text-muted);
}
.uppdrag-tab.active {
    background: rgba(var(--teal-rgb), 0.12);
    border-color: rgba(var(--teal-rgb), 0.35);
    color: var(--teal);
    box-shadow: 0 0 12px rgba(var(--teal-rgb), 0.1);
}

.uppdrag-no-active {
    position: relative; z-index: 1;
    text-align: center;
    max-width: 680px; margin: 2rem auto;
    padding: 2rem 1rem;
    color: var(--text-subtle);
    font-size: 0.9rem;
}

/* ==========================================================================
   SCOREBOARD
   ========================================================================== */

.scoreboard-section {
    position: relative; z-index: 1;
    padding: 1.5rem 1rem;
    max-width: 680px; margin: 0 auto;
}

.scoreboard-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
}

.scoreboard-title {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--text-subtle);
    margin-bottom: 1rem;
}
.scoreboard-title svg { width: 16px; height: 16px; }

.scoreboard-list { list-style: none; }

.scoreboard-row {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}
.scoreboard-row:last-child { border-bottom: none; }

.scoreboard-rank {
    width: 32px; height: 32px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 800;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    background: var(--glass-hover);
    color: var(--text-subtle);
}
.scoreboard-row:nth-child(1) .scoreboard-rank {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.25);
}
.scoreboard-row:nth-child(2) .scoreboard-rank {
    background: linear-gradient(135deg, #E0E0E0, #A0A0A0);
    color: #000;
}
.scoreboard-row:nth-child(3) .scoreboard-rank {
    background: linear-gradient(135deg, #CD7F32, #A0522D);
    color: #fff;
}

.scoreboard-name {
    flex: 1; min-width: 0;
    font-weight: 600; font-size: 0.92rem;
    color: var(--text-light);
    text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
}

.scoreboard-points {
    font-weight: 800; font-size: 1.2rem;
    color: var(--teal);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    min-width: 50px;
    text-align: right;
}

.scoreboard-points-label {
    font-size: 0.65rem; font-weight: 400;
    color: var(--text-subtle);
    margin-left: 0.2rem;
}

.scoreboard-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-subtle);
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .uppdrag-tabs { padding: 0 0.75rem; gap: 0.4rem; }
    .uppdrag-tab { padding: 0.5rem 1rem; font-size: 0.8rem; }
    .scoreboard-card { padding: 1rem; }
    .scoreboard-rank { width: 28px; height: 28px; font-size: 0.72rem; }
    .scoreboard-points { font-size: 1rem; }
}

/* ==========================================================================
   SECTION
   ========================================================================== */

.section {
    position: relative; z-index: 1;
    padding: 1.5rem 1rem;
    max-width: 680px; margin: 0 auto;
}

.section-label {
    display: inline-block;
    font-size: 0.65rem; font-weight: 700; letter-spacing: 3px;
    text-transform: uppercase; color: var(--teal); margin-bottom: 0.6rem; opacity: 0.8;
}

.section-title {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    font-weight: 700; margin-bottom: 1rem; color: var(--text-light);
}

/* ==========================================================================
   GLASS CARD
   ========================================================================== */

.glass-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    padding: 2rem;
    transition: border-color var(--transition-slow), box-shadow var(--transition-slow);
}

.submit-card {
    border-color: rgba(var(--teal-rgb), 0.1);
    box-shadow: 0 4px 30px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.02);
}

/* ==========================================================================
   FORM
   ========================================================================== */

.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
    margin-bottom: 0.45rem; letter-spacing: 0.2px;
}
.form-label-icon { width: 16px; height: 16px; color: var(--teal); opacity: 0.7; flex-shrink: 0; }
.form-label .required { color: var(--color-error); margin-left: 2px; }
.form-hint { color: var(--text-subtle); font-weight: 400; font-size: 0.78rem; }

.form-input {
    width: 100%; padding: 0.85rem 1rem;
    background: rgba(15, 30, 50, 0.7);
    border: 1.5px solid rgba(var(--teal-rgb), 0.15);
    border-radius: var(--radius-md);
    color: var(--text-light); font-size: 1rem; font-family: inherit;
    outline: none;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
    -webkit-appearance: none;
}
.form-input::placeholder { color: rgba(255,255,255,0.5); }
.form-input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(var(--teal-rgb), 0.12), 0 0 20px rgba(var(--teal-rgb), 0.08);
    background: rgba(15, 30, 50, 0.9);
}
.form-input:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

.form-textarea {
    width: 100%; padding: 0.85rem 1rem;
    background: rgba(15, 30, 50, 0.7);
    border: 1.5px solid rgba(var(--teal-rgb), 0.15);
    border-radius: var(--radius-md);
    color: var(--text-light); font-size: 1rem; font-family: inherit;
    outline: none; resize: vertical; min-height: 110px; line-height: 1.6;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
    -webkit-appearance: none;
}
.form-textarea::placeholder { color: rgba(255,255,255,0.5); }
.form-textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(var(--teal-rgb), 0.12), 0 0 20px rgba(var(--teal-rgb), 0.08);
}
.form-textarea:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

/* ==========================================================================
   MEMBERS
   ========================================================================== */

.members-container {
    background: rgba(15, 30, 50, 0.4);
    border: 1.5px solid rgba(var(--teal-rgb), 0.1);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    transition: border-color var(--transition-base);
}
.members-container:focus-within {
    border-color: rgba(var(--teal-rgb), 0.3);
}

.members-chips {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
    padding: 0 0 0.3rem;
    min-height: 0;
}

.members-chips:empty { padding: 0; }

.member-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.3rem 0.5rem 0.3rem 0.7rem;
    background: rgba(var(--teal-rgb), 0.12);
    border: 1px solid rgba(var(--teal-rgb), 0.2);
    border-radius: var(--radius-full);
    font-size: 0.8rem; font-weight: 500; color: var(--teal);
    animation: chipIn 0.25s var(--transition-spring);
}

@keyframes chipIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.member-chip-remove {
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08);
    border: none; border-radius: 50%;
    color: rgba(255,255,255,0.5); font-size: 0.7rem;
    cursor: pointer; transition: all var(--transition-fast);
    padding: 0; line-height: 1;
}
.member-chip-remove:hover { background: rgba(255,69,58,0.2); color: var(--color-error); }

.member-input-row { display: flex; gap: 0.4rem; }
.member-input { flex: 1; margin: 0; border: none; background: transparent; padding: 0.6rem 0.8rem; }
.member-input:focus { box-shadow: none; }

.member-add-btn {
    width: 40px; height: 40px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(var(--teal-rgb), 0.1);
    border: 1.5px solid rgba(var(--teal-rgb), 0.2);
    border-radius: var(--radius-sm);
    color: var(--teal); cursor: pointer;
    transition: all var(--transition-spring);
}
.member-add-btn:hover { background: rgba(var(--teal-rgb), 0.2); transform: scale(1.05); }
.member-add-btn:active { transform: scale(0.95); }
.member-add-btn svg { width: 18px; height: 18px; }

/* ==========================================================================
   CONTENT TYPE SELECTOR
   ========================================================================== */

.content-type-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}

.content-type-option { position: relative; cursor: pointer; }
.content-type-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }

.content-type-card {
    display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
    padding: 1rem 0.4rem;
    background: rgba(15, 30, 50, 0.5);
    border: 1.5px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    transition: all var(--transition-spring);
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}
.content-type-card:hover {
    border-color: rgba(var(--teal-rgb), 0.25);
    background: rgba(var(--teal-rgb), 0.04);
    transform: translateY(-2px);
}
.content-type-card:active { transform: translateY(0) scale(0.97); }

.content-type-option input:checked + .content-type-card {
    border-color: var(--teal);
    background: rgba(var(--teal-rgb), 0.1);
    box-shadow: 0 0 20px rgba(var(--teal-rgb), 0.12), inset 0 1px 0 rgba(var(--teal-rgb), 0.1);
}

.content-type-icon { width: 26px; height: 26px; color: var(--text-subtle); transition: color var(--transition-base); }
.content-type-option input:checked + .content-type-card .content-type-icon { color: var(--teal); }

.content-type-label { font-size: 0.72rem; font-weight: 600; color: var(--text-subtle); transition: color var(--transition-base); }
.content-type-option input:checked + .content-type-card .content-type-label { color: var(--teal); }

/* ==========================================================================
   CONTENT AREAS
   ========================================================================== */

.content-area { display: none; animation: fadeInUp 0.3s ease-out; }
.content-area.active { display: block; }

/* ==========================================================================
   UPLOAD ZONE
   ========================================================================== */

.upload-zone {
    border: 2px dashed rgba(var(--teal-rgb), 0.2);
    border-radius: var(--radius-lg);
    background: rgba(15, 30, 50, 0.3);
    padding: 2.5rem 1.5rem;
    text-align: center; cursor: pointer;
    transition: all var(--transition-slow);
    -webkit-tap-highlight-color: transparent;
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--teal);
    background: rgba(var(--teal-rgb), 0.05);
    box-shadow: 0 0 30px rgba(var(--teal-rgb), 0.08);
}
.upload-zone-icon {
    width: 42px; height: 42px; color: var(--teal); margin: 0 auto 0.8rem; opacity: 0.5;
    transition: opacity var(--transition-base), transform var(--transition-spring);
}
.upload-zone:hover .upload-zone-icon { opacity: 1; transform: translateY(-3px); }
.upload-zone-text { font-size: 0.9rem; color: var(--text-subtle); margin-bottom: 0.3rem; }
.upload-zone-hint { font-size: 0.75rem; color: rgba(255,255,255,0.5); }

/* File preview */
.file-preview { display: none; margin-top: 0.8rem; animation: fadeInUp 0.3s ease-out; }
.file-preview.active { display: block; }
.file-preview-inner {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.8rem; background: rgba(15, 30, 50, 0.5);
    border: 1px solid rgba(var(--teal-rgb), 0.12);
    border-radius: var(--radius-md); position: relative;
}
.preview-image { max-width: 100%; max-height: 180px; border-radius: var(--radius-sm); object-fit: contain; display: block; margin: 0 auto; }
.preview-file-icon { width: 36px; height: 36px; color: var(--teal); flex-shrink: 0; }
.preview-filename { font-size: 0.85rem; font-weight: 500; color: var(--text-light); word-break: break-all; }
.preview-filesize { font-size: 0.75rem; color: var(--text-subtle); margin-top: 0.1rem; }
.preview-remove {
    position: absolute; top: 0.5rem; right: 0.5rem;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 69, 58, 0.12); border: 1px solid rgba(255, 69, 58, 0.2);
    border-radius: 8px; color: var(--color-error); font-size: 1.1rem;
    cursor: pointer; transition: all var(--transition-fast);
    padding: 0; line-height: 1;
}
.preview-remove:hover { background: rgba(255, 69, 58, 0.25); }

/* ==========================================================================
   UPLOAD PROGRESS
   ========================================================================== */

.upload-progress {
    display: none; margin-bottom: 1rem;
    position: relative;
    height: 6px; background: rgba(255,255,255,0.06);
    border-radius: var(--radius-full); overflow: hidden;
}
.upload-progress.active { display: block; }

.upload-progress-bar {
    height: 100%; width: 0;
    background: linear-gradient(90deg, var(--teal), var(--primary-blue), #5E5CE6);
    background-size: 200% 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    animation: gradientShift 2s ease infinite;
    box-shadow: 0 0 12px rgba(var(--teal-rgb), 0.4);
}

.upload-progress-text {
    position: absolute; right: 0; top: 12px;
    font-size: 0.7rem; font-weight: 600; color: var(--teal);
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.9rem 2rem; border: none; border-radius: var(--radius-md);
    font-size: 1rem; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all var(--transition-base);
    position: relative; overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-icon { width: 18px; height: 18px; flex-shrink: 0; }

.btn-submit {
    background: linear-gradient(135deg, #32D74B 0%, #30D158 50%, #28CD41 100%);
    background-size: 200% 200%;
    color: #fff; width: 100%;
    min-height: 52px;
    box-shadow: 0 4px 20px rgba(50, 215, 75, 0.35), 0 1px 3px rgba(0,0,0,0.2);
    animation: gradientShift 3s ease infinite, submitGlow 2.5s ease-in-out infinite;
    border-radius: var(--radius-lg);
}

@keyframes submitGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(50, 215, 75, 0.35), 0 1px 3px rgba(0,0,0,0.2); }
    50% { box-shadow: 0 6px 30px rgba(50, 215, 75, 0.5), 0 1px 3px rgba(0,0,0,0.2); }
}

.btn-submit::before {
    content: ''; position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.btn-submit:hover::before { left: 100%; }
.btn-submit:hover { transform: translateY(-2px); }
.btn-submit:active { transform: translateY(0) scale(0.98); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; animation: none !important; }
.btn-submit:disabled::before { display: none; }

.btn-submit.loading .btn-text, .btn-submit.loading .btn-icon { opacity: 0; }
.btn-submit.loading::after {
    content: ''; position: absolute;
    width: 22px; height: 22px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff; border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   FORM FEEDBACK
   ========================================================================== */

.form-message {
    padding: 0.75rem 1rem; border-radius: var(--radius-md);
    font-size: 0.85rem; font-weight: 500; margin-bottom: 1rem;
    display: none; animation: shakeIn 0.4s ease-out;
}
.form-message.active { display: flex; align-items: center; gap: 0.4rem; }
.form-message.error {
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid rgba(255, 69, 58, 0.2);
    color: var(--color-error);
}
.form-message.success {
    background: rgba(50, 215, 75, 0.1);
    border: 1px solid rgba(50, 215, 75, 0.2);
    color: var(--color-success);
}

@keyframes shakeIn {
    0% { opacity: 0; transform: translateX(-8px); }
    40% { transform: translateX(6px); }
    70% { transform: translateX(-3px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   FEED
   ========================================================================== */

.feed-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 1.2rem; flex-wrap: wrap; gap: 0.75rem;
}
.feed-header-left { display: flex; flex-direction: column; gap: 0.2rem; }
.feed-count { font-size: 0.8rem; color: var(--text-subtle); }

.refresh-btn {
    display: flex; align-items: center; gap: 0.35rem;
    padding: 0.5rem 0.9rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: var(--text-subtle); font-size: 0.78rem; font-weight: 500; font-family: inherit;
    cursor: pointer; transition: all var(--transition-base);
    -webkit-tap-highlight-color: transparent;
}
.refresh-btn:hover { background: rgba(var(--teal-rgb), 0.06); border-color: rgba(var(--teal-rgb), 0.2); color: var(--teal); }
.refresh-btn svg { width: 15px; height: 15px; transition: transform 0.5s ease; }
.refresh-btn.spinning svg { animation: spin 0.6s linear infinite; }

/* ==========================================================================
   FEED CARDS
   ========================================================================== */

.feed-grid { display: flex; flex-direction: column; gap: 0.8rem; }

.feed-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0; transform: translateY(15px);
}
.feed-card.visible { opacity: 1; transform: translateY(0); }
.feed-card:hover { border-color: rgba(var(--teal-rgb), 0.15); box-shadow: 0 10px 30px rgba(0,0,0,0.12); }

.feed-card-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem;
    padding: 1rem 1.2rem 0.6rem;
}
.feed-card-group {
    font-size: 0.95rem; font-weight: 700; color: var(--teal);
    display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
}
.feed-card-type {
    font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px;
    padding: 0.15rem 0.45rem;
    background: rgba(var(--teal-rgb), 0.08); border-radius: 5px;
    color: rgba(var(--teal-rgb), 0.7);
}
.feed-card-time { font-size: 0.75rem; color: rgba(255,255,255,0.5); white-space: nowrap; flex-shrink: 0; padding-top: 0.1rem; }

.feed-card-members {
    padding: 0 1.2rem 0.4rem;
    font-size: 0.75rem; color: var(--text-subtle);
    display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap;
}
.feed-card-members svg { width: 12px; height: 12px; opacity: 0.5; flex-shrink: 0; }

.feed-card-content { padding: 0.6rem 1.2rem 1.2rem; }

/* Text */
.feed-text {
    font-size: 0.95rem; line-height: 1.65; color: var(--text-muted);
    white-space: pre-wrap; word-break: break-word;
}

/* Image */
.feed-image-container { border-radius: var(--radius-sm); overflow: hidden; }
.feed-image {
    width: 100%; display: block; object-fit: cover;
    cursor: pointer; transition: transform var(--transition-slow);
    max-height: 450px;
}
.feed-image:hover { transform: scale(1.015); }

/* Video */
.feed-video-container { border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.feed-video { width: 100%; display: block; border-radius: var(--radius-sm); }

/* File download */
.feed-file-download {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: rgba(15, 30, 50, 0.4);
    border: 1px solid rgba(var(--teal-rgb), 0.12);
    border-left: 3px solid var(--teal);
    border-radius: var(--radius-md);
    text-decoration: none; cursor: pointer;
    transition: all var(--transition-base);
}
.feed-file-download:hover {
    background: rgba(var(--teal-rgb), 0.05);
    border-color: rgba(var(--teal-rgb), 0.25);
    transform: translateY(-1px);
}
.feed-file-icon { width: 32px; height: 32px; color: var(--teal); flex-shrink: 0; }
.feed-file-info { flex: 1; min-width: 0; }
.feed-filename { font-size: 0.85rem; font-weight: 500; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-filesize { font-size: 0.75rem; color: var(--text-subtle); margin-top: 0.1rem; }
.feed-download-icon { width: 18px; height: 18px; color: var(--text-subtle); flex-shrink: 0; }
.feed-file-download:hover .feed-download-icon { color: var(--teal); }

/* PDF embed */
.feed-pdf-container {
    border-radius: var(--radius-sm); overflow: hidden;
    background: rgba(15, 30, 50, 0.5);
    border: 1px solid rgba(var(--teal-rgb), 0.1);
}
.feed-pdf-frame {
    width: 100%; height: 400px; border: none;
    border-radius: var(--radius-sm);
}
.feed-pdf-actions {
    display: flex; gap: 0.5rem; padding: 0.6rem;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.feed-pdf-btn {
    display: flex; align-items: center; gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    background: rgba(var(--teal-rgb), 0.08);
    border: 1px solid rgba(var(--teal-rgb), 0.15);
    border-radius: 8px;
    color: var(--teal); font-size: 0.75rem; font-weight: 500; font-family: inherit;
    cursor: pointer; text-decoration: none;
    transition: all var(--transition-fast);
}
.feed-pdf-btn:hover { background: rgba(var(--teal-rgb), 0.15); }
.feed-pdf-btn svg { width: 14px; height: 14px; }

/* ==========================================================================
   EMPTY & SKELETON
   ========================================================================== */

.feed-empty {
    text-align: center; padding: 3rem 1.5rem;
    background: var(--glass); border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
}
.feed-empty svg { width: 56px; height: 56px; color: rgba(var(--teal-rgb), 0.25); margin-bottom: 1.2rem; }
.feed-empty h3 { font-size: 1.05rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.4rem; }
.feed-empty p { font-size: 0.85rem; color: var(--text-subtle); }

.skeleton-card {
    background: var(--glass); border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl); padding: 1.2rem; overflow: hidden;
}
.skeleton-line {
    height: 12px; background: rgba(255,255,255,0.03);
    border-radius: 6px; margin-bottom: 0.6rem;
    position: relative; overflow: hidden;
}
.skeleton-line::after {
    content: ''; position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    animation: shimmer 1.5s infinite;
}
.skeleton-line.short { width: 35%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long { width: 85%; }
.skeleton-line.tall { height: 120px; }

@keyframes shimmer { to { left: 100%; } }

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */

.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.88);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
    cursor: pointer;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}
.lightbox.active { opacity: 1; visibility: visible; }
.lightbox img {
    max-width: 95vw; max-height: 90vh;
    object-fit: contain; border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transform: scale(0.92); transition: transform 0.3s ease;
}
.lightbox.active img { transform: scale(1); }

.lightbox-close {
    position: absolute; top: 1rem; right: 1rem;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%; color: #fff; font-size: 1.4rem;
    cursor: pointer; transition: all var(--transition-fast);
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ==========================================================================
   PDF VIEWER MODAL
   ========================================================================== */

.pdf-viewer {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 22, 42, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex; flex-direction: column;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}
.pdf-viewer.active { opacity: 1; visibility: visible; }

.pdf-viewer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.8rem 1rem;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pdf-viewer-title { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-viewer-actions { display: flex; gap: 0.5rem; }

.pdf-download-btn, .pdf-close-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; color: #fff;
    cursor: pointer; text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 1.3rem;
}
.pdf-download-btn:hover, .pdf-close-btn:hover { background: rgba(255,255,255,0.1); }
.pdf-download-btn svg { width: 18px; height: 18px; }

.pdf-frame { flex: 1; border: none; background: #fff; }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
    position: relative; z-index: 1;
    text-align: center;
    padding: 2.5rem 1.5rem calc(2.5rem + var(--safe-bottom));
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.03);
}
.footer-text { font-size: 0.8rem; color: rgba(255,255,255,0.5); }

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0; transform: translateY(25px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* New item highlight */
.feed-card.new-item {
    animation: newItemGlow 1.5s ease-out;
}
@keyframes newItemGlow {
    0% { box-shadow: 0 0 0 0 rgba(var(--teal-rgb), 0.4); }
    50% { box-shadow: 0 0 20px 4px rgba(var(--teal-rgb), 0.15); }
    100% { box-shadow: none; }
}

/* ==========================================================================
   RESPONSIVE — MOBILE FIRST
   ========================================================================== */

@media (max-width: 600px) {
    .hero { min-height: 25vh; padding: 2.5rem 1rem 1rem; }
    .section { padding: 1rem 0.75rem; }
    .glass-card { padding: 1.3rem; border-radius: var(--radius-xl); }
    .content-type-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .content-type-card { padding: 0.9rem 0.3rem; }
    .upload-zone { padding: 2rem 1rem; }
    .stats-bar { padding: 0.8rem 1.2rem; gap: 1rem; margin-left: 0.75rem; margin-right: 0.75rem; }
    .stat-number { font-size: 1.2rem; }
    .feed-card { border-radius: var(--radius-lg); }
    .feed-card-header { padding: 0.8rem 1rem 0.5rem; }
    .feed-card-content { padding: 0.5rem 1rem 1rem; }
    .feed-card-members { padding: 0 1rem 0.3rem; }
    .feed-pdf-frame { height: 300px; }
    .btn-submit { min-height: 50px; font-size: 0.95rem; }
}

@media (max-width: 380px) {
    .stats-bar { gap: 0.7rem; padding: 0.7rem 1rem; }
    .stat-number { font-size: 1.1rem; }
    .stat-label { font-size: 0.6rem; letter-spacing: 1px; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .ambient-orb { animation: none; }
    .feed-card { opacity: 1; transform: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
}
