/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #f1f5f9;
    --accent: #e9ebef;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #ffffff;
    --foreground: #0f172a;
    --card: #ffffff;
    --border: rgba(0, 0, 0, 0.1);
    --muted: #64748b;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body.dark-mode {
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --background: #030916e4;
    --foreground: #f1f5f9;
    --card: #0b0d1a;
    --border: rgba(255, 255, 255, 0.1);
    --secondary: #051a3bd4;
    --accent: #0d0f1223;
}
/* This ensures the labels inside the cards turn light in dark mode */
body.dark-mode .interest-card h3 {
    color: var(--foreground);
}
/* Fix the Icon and Text visibility for Interests in Dark Mode */
body.dark-mode .interest-item i {
    color: var(--primary); /* Makes the icons purple/blue instead of dark grey */
}

body.dark-mode .interest-item span {
    color: var(--foreground); /* Makes "Tech", "Sports", etc. light grey/white */
}

/* Fix the "I am an Organizer" text visibility in Dark Mode */
body.dark-mode .checkbox-row span {
    color: var(--foreground);
}
/* ================= DARK MODE TEXT VISIBILITY FIXES ================= */

/* Onboarding Step 2 – College names */
body.dark-mode .college-item div:first-child {
    color: var(--foreground);
}

body.dark-mode .college-item div:last-child {
    color: rgba(241, 245, 249, 0.7);
}

/* Event titles (Registration & cards) */
body.dark-mode .event-title,
body.dark-mode .card h2,
body.dark-mode .card h3 {
    color: var(--foreground);
}

/* General card text safety */
body.dark-mode .card p,
body.dark-mode .card span {
    color: rgba(241, 245, 249, 0.85);
}


body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Container */
#app {
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Screen Animations */
.screen {
    animation: fadeIn 0.3s ease-in-out;
}

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--foreground);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--secondary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

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

/* Input Fields */
.input-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--foreground);
}

input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--background);
    color: var(--foreground);
    transition: all 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

/* Cards */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 20px;
}

/* Event Cards */
.event-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border);
}

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

.event-card:active {
    transform: scale(0.98);
}

.event-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    position: relative;
}

.event-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-card-content {
    padding: 16px;
}

.event-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    margin-bottom: 8px;
}

.event-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--foreground);
}

.event-college {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--foreground);
    font-size: 0.9rem;
}

.event-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-info-item i {
    color: var(--primary);
    width: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s;
}

.progress-fill.warning {
    background: var(--warning);
}

.progress-fill.danger {
    background: var(--danger);
}

/* Filter Chips */
.filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--border);
    background: var(--background);
    color: var(--foreground);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.filter-chip:hover {
    border-color: var(--primary);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    background: var(--card);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item i {
    font-size: 1.5rem;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: scale(1.1);
}

/* Header */
.header {
    padding: 16px 20px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--secondary);
    color: var(--foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.back-btn:hover {
    background: var(--accent);
}

/* Container */
.container {
    max-width: 768px;
    margin: 0 auto;
    padding: 20px;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Onboarding */
.onboarding {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, var(--background) 50%, rgba(236, 72, 153, 0.1) 100%);
    padding: 20px;
}

.onboarding-card {
    width: 100%;
    max-width: 500px;
    background: var(--card);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.progress-steps {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
}

.progress-step {
    flex: 1;
    height: 4px;
    background: var(--secondary);
    border-radius: 2px;
    transition: all 0.3s;
}

.progress-step.active {
    background: var(--primary);
}

.college-list {
    max-height: 320px;
    overflow-y: auto;
}

.college-item {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    margin-bottom: 8px;
}

.college-item:hover {
    border-color: var(--primary);
    background: var(--secondary);
}

.college-item.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.interest-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.interest-item {
    padding: 24px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.interest-item i {
    font-size: 2rem;
    color: var(--muted);
}

.interest-item:hover {
    border-color: var(--primary);
}

.interest-item.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.interest-item.selected i {
    color: var(--primary);
}

/* Search */
.search-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.search-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

.search-input {
    padding-left: 48px;
}

/* 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: 2000;
    padding: 20px;
    animation: fadeIn 0.2s;
}

.modal-content {
    background: var(--card);
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideInRight 0.3s;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--secondary);
    color: var(--foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

/* QR Code */
.qr-ticket {
    text-align: center;
}

.qr-code {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    display: inline-block;
    margin: 20px 0;
}

/* Tabs */
.tabs {
    margin-bottom: 20px;
}

.tab-list {
    display: flex;
    border-bottom: 2px solid var(--border);
    gap: 8px;
}

.tab-button {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: none;
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    padding-top: 20px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    text-align: center;
    padding: 16px;
}

.stat-card i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--foreground);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
}

/* Profile */
.profile-header {
    text-align: center;
    padding: 32px 20px;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 16px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    margin: 4px;
}

/* Settings */
.settings-section {
    margin-bottom: 24px;
}

.settings-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.settings-item {
    width: 100%;
    padding: 16px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--foreground);
    text-align: left;
    transition: background 0.2s;
}

.settings-item:hover {
    background: var(--secondary);
}

.settings-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-item i {
    color: var(--primary);
    width: 24px;
}

/* Toggle Switch */
.toggle {
    width: 48px;
    height: 28px;
    background: var(--border);
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle.active {
    background: var(--primary);
}

.toggle-slider {
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle.active .toggle-slider {
    transform: translateX(20px);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card);
    color: var(--foreground);
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    animation: slideUp 0.3s;
    border: 1px solid var(--border);
    max-width: 90%;
}

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

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Success Animation */
.success-icon {
    width: 80px;
    height: 80px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.success-icon i {
    font-size: 3rem;
    color: var(--success);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--muted);
}

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-full {
    width: 100%;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 16px;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.35rem; }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .interest-grid {
        grid-template-columns: 1fr;
    }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 64px 32px;
}

.empty-state i {
    font-size: 4rem;
    color: var(--muted);
    opacity: 0.5;
    margin-bottom: 16px;
}

.empty-state h3 {
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--muted);
    margin-bottom: 24px;
}

/* Ensure the container doesn't force a vertical stack */
.checkbox-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    cursor: pointer;
    margin: 15px 0;
}

/* Prevent the checkbox or text from stretching */
.checkbox-row input, 
.checkbox-row span {
    width: auto !important;
    margin: 0;
}

.app-footer {
    position: fixed;
    bottom: 1px;          /* sits in the gap */
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    text-align: center;
    color: #eeececc6;
    opacity: 0.85;
    z-index: 999;
    pointer-events: none; /* optional */
}
