:root {
    /* Light Theme - Premium Soft */
    --bg-color: #fafafa;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.1);
    --secondary: #10b981;
    --secondary-hover: #059669;
    --secondary-light: rgba(16, 185, 129, 0.1);
    --accent: #ec4899;
    --surface: #ffffff;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* Dark Theme - Sleek Modern */
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --primary-light: rgba(129, 140, 248, 0.15);
    --secondary: #34d399;
    --secondary-hover: #10b981;
    --secondary-light: rgba(52, 211, 153, 0.15);
    --accent: #f472b6;
    --surface: #1e293b;
    --border: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

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

/* Background Mesh / Blobs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .blob {
    opacity: 0.15;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--primary);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--accent);
    animation-delay: -5s;
    animation-duration: 25s;
}

.blob-3 {
    top: 30%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: var(--secondary);
    animation-delay: -10s;
    animation-duration: 15s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(5%, 5%) scale(1.1) rotate(10deg); }
    66% { transform: translate(-5%, 10%) scale(0.9) rotate(-10deg); }
    100% { transform: translate(10%, -5%) scale(1) rotate(5deg); }
}

/* Utilities */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Navigation */
.navbar {
    position: sticky;
    top: 1rem;
    margin: 0 auto;
    width: calc(75% - 2rem);
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    z-index: 100;
    transition: var(--transition);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    
}

.nav-brand i {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-btn:hover {
    color: var(--text-primary);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.nav-btn.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    margin-left: 0.5rem;
}

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

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu {
    position: fixed;
    top: 5rem;
    left: 1rem;
    right: 1rem;
    display: flex; /* Changed from just missing display */
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    z-index: 99;
}

.mobile-menu.hidden {
    display: none !important;
}

.mobile-menu .nav-btn {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
}

/* Main Content Area */
.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    min-height: calc(100vh - 12rem);
}

.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-align: center;
}

.btn i {
    font-size: 1.2rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.3);
    color: #ffffff;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-color);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

.btn-text {
    background: transparent;
    color: var(--primary);
    padding: 0.5rem;
}

.btn-text:hover {
    color: var(--primary-hover);
    gap: 0.75rem; /* For arrow animation */
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 5rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.lost-icon { 
    background: rgba(239, 68, 68, 0.1); 
    color: #ef4444; 
}
.found-icon { 
    background: rgba(16, 185, 129, 0.1); 
    color: #10b981; 
}
.reunited-icon { 
    background: rgba(236, 72, 153, 0.1); 
    color: #ec4899; 
}

.stat-info h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-number {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

/* Listings & Grids */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.listing-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
}

.listing-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.listing-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 60%; /* 5:3 Aspect Ratio */
    overflow: hidden;
}

.listing-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.listing-card:hover .listing-img {
    transform: scale(1.05);
}

.listing-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.badge-lost {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.badge-found {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.listing-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.listing-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.listing-meta i {
    color: var(--primary);
    font-size: 1.1rem;
}

.listing-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.listing-category {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: capitalize;
    font-weight: 500;
}

/* Filters */
.page-header {
    text-align: center;
    margin: 2rem 0 3rem;
}

.page-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.filters-container {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.search-bar {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1.25rem;
}

.search-bar input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.filter-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.custom-select {
    padding: 0.875rem 3rem 0.875rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") no-repeat right 1rem center / 1.25rem;
    appearance: none;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    min-width: 160px;
}

.custom-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 1rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Forms */
.form-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 3rem;
}

.form-header {
    text-align: center;
    margin-bottom: 3rem;
}

.form-icon {
    width: 5rem;
    height: 5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
    color: white;
}

.form-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input[type="text"], input[type="date"], select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

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

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* File Upload */
.file-drop-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 3rem 2rem;
    text-align: center;
    background: var(--surface);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.file-drop-area:hover, .file-drop-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-drop-area i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.file-msg {
    font-weight: 500;
    color: var(--text-secondary);
}

.file-input {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    opacity: 0;
    cursor: pointer;
}

.image-preview-container {
    position: relative;
    margin-top: 1rem;
    width: 100%;
    max-width: 300px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.image-preview-container img {
    width: 100%;
    height: auto;
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.remove-image-btn:hover {
    background: #ef4444;
    transform: scale(1.1);
}

/* Item Details */
.back-btn {
    margin-bottom: 2rem;
}

.details-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    overflow: hidden;
}

@media (min-width: 900px) {
    .details-container {
        grid-template-columns: 1fr 1fr;
    }
}

.details-img-container {
    width: 100%;
    height: 400px;
}

@media (min-width: 900px) {
    .details-img-container {
        height: 100%;
        min-height: 500px;
    }
}

.details-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.details-info {
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

.details-header {
    margin-bottom: 2rem;
}

.details-header .listing-badge {
    position: static;
    display: inline-block;
    margin-bottom: 1rem;
}

.details-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.details-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}

.meta-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.meta-item i {
    font-size: 1.5rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.meta-item div span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.meta-item div p {
    font-weight: 500;
    color: var(--text-primary);
}

.details-description {
    margin-bottom: 3rem;
}

.details-description h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.details-description p {
    white-space: pre-line;
}

.details-actions {
    margin-top: auto;
    display: flex;
    gap: 1rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    z-index: 1000;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.toast.fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.toast-icon {
    font-size: 1.5rem;
    color: var(--secondary);
}

.toast-content h4 { 
    margin-bottom: 0.25rem; 
    font-size: 1rem;
}
.toast-content p { 
    font-size: 0.875rem; 
    margin: 0;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    margin-left: 1rem;
    padding: 0.25rem;
    transition: var(--transition);
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 900px) {
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .form-container { padding: 2rem 1.5rem; }
    .details-info { padding: 2rem; }
    .hero h1 { font-size: 2.5rem; }
}

@media (max-width: 640px) {
    .navbar { padding: 1rem; width: 100%; top: 0; border-radius: 0; border-left: none; border-right: none; border-top: none; }
    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }
    .hero-actions { flex-direction: column; width: 100%; }
    .hero-actions .btn { width: 100%; }
    .filters-container { flex-direction: column; }
    .search-bar, .filter-controls { width: 100%; }
    .filter-controls { flex-direction: column; }
    .custom-select { width: 100%; }
    .details-meta-grid { grid-template-columns: 1fr; }
    .toast { left: 1rem; right: 1rem; bottom: 1rem; justify-content: space-between; }
}

/* Timestamp update */
