/*
 * Giggly - Event Discovery App
 *
 * Structure:
 * 1. Reset & Base Styles
 * 2. Theme Variables
 * 3. Landing Page
 * 4. App Layout (Header, Tabs, Events)
 * 5. Search Overlay
 * 6. Bottom Navigation
 * 7. Modals
 * 8. Responsive
 */

/* ==========================================================================
   1. Reset & Base Styles
   ========================================================================== */

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

/* iOS Safari fixes */
body {
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* Fix iOS input zoom */
input,
select,
textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
}

/* Fix iOS button appearance */
button,
input[type="submit"],
input[type="button"] {
    -webkit-appearance: none;
    appearance: none;
}

/* Fix iOS sticky hover states */
@media (hover: none) {
    .filter-button:hover,
    .star-button:hover,
    .ticket-button:hover {
        transform: none;
    }
}

/* ==========================================================================
   2. Theme Variables
   ========================================================================== */

:root {
    --bg: #ffffff;
    --bg-gradient-start: #f8f9fa;
    --bg-gradient-end: #e9ecef;
    --text: #212529;
    --text-secondary: #6c757d;
    --accent-pink: #EC4899;
    --accent-purple: #8B5CF6;
    --accent-blue: #6B9FFF;
    --border: #dee2e6;
    --tag-bg: rgba(107, 159, 255, 0.1);
    --tag-border: rgba(107, 159, 255, 0.3);
    --footer-text: #adb5bd;
}

[data-theme="dark"] {
    --bg: #1a0f2e;
    --bg-gradient-start: #1a0f2e;
    --bg-gradient-end: #2a1f3d;
    --text: #E8E4ED;
    --text-secondary: #B8B0C4;
    --border: #3d2f52;
    --tag-bg: rgba(107, 159, 255, 0.1);
    --tag-border: rgba(107, 159, 255, 0.3);
    --footer-text: #3d2f52;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

body.modal-open,
body.app-mode.modal-open {
    overflow: hidden !important;
}

/* ==========================================================================
   3. Landing Page
   ========================================================================== */

.container {
    text-align: center;
    max-width: 500px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    width: 180px;
    height: 180px;
    margin: 0 auto 40px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

h1 {
    font-size: 72px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-purple) 50%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

p {
    font-size: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 40px;
}

.tags {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    background: var(--tag-bg);
    border: 1px solid var(--tag-border);
    color: var(--accent-blue);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.beta-badge {
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-purple) 100%);
    color: white;
    border: none;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text);
    padding: 0;
    margin-left: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    vertical-align: middle;
}

.theme-toggle:hover {
    transform: scale(1.2);
}

.theme-toggle:active {
    transform: scale(0.9);
}

.auth-box {
    width: 100%;
    max-width: 320px;
    margin: 0 auto 30px;
    padding: 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: border-color 0.2s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.auth-input::placeholder {
    color: var(--text-secondary);
}

.auth-button {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-purple) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.auth-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.auth-button:active:not(:disabled) {
    transform: translateY(0);
}

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-button-secondary {
    width: 100%;
    padding: 12px 16px;
    margin-top: 8px;
    font-size: 14px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-button-secondary:hover {
    border-color: var(--accent-blue);
    color: var(--text);
}

.status-message {
    display: none;
    padding: 12px;
    margin-top: 12px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.status-message.success {
    background: rgba(107, 159, 255, 0.1);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
}

.status-message.error {
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid var(--accent-pink);
    color: var(--accent-pink);
}

.footer {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--footer-text);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

body.app-mode .footer {
    display: none;
}

.back-link {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 14px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--text);
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.auth-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   4. App Layout (Header, Tabs, Events)
   ========================================================================== */

.app-container {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
}

body.app-mode {
    display: block;
    padding: 0;
    background: var(--bg);
    justify-content: flex-start;
    align-items: stretch;
}

.app-header {
    background: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    backdrop-filter: blur(28px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 16px 20px;
    padding-top: calc(16px + env(safe-area-inset-top));
    max-width: 840px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    display: none;
}

.app-header h1 {
    font-size: 24px;
    margin: 0;
    line-height: 1.2;
}

/* Filter tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    padding: 0 20px 12px 20px;
    max-width: 840px;
    margin: 0 auto;
    background: transparent;
    border-bottom: none;
    position: sticky;
    top: 73px;
    z-index: 99;
}

.filter-tab {
    flex: 1;
    padding: 10px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.filter-tab.active {
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-purple) 100%);
    color: white;
    border-color: transparent;
}

.tab-count {
    font-size: 13px;
    opacity: 0.75;
    font-weight: 400;
}

.filter-tab:hover:not(.active) {
    border-color: var(--accent-blue);
    color: var(--text);
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.icon-button {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    color: var(--text);
    text-decoration: none;
    transition: transform 0.2s ease;
}

.icon-button:hover {
    transform: scale(1.1);
}

/* Profile avatar */
.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #EC4899 0%, #8B5CF6 100%);
    background-color: #8B5CF6;
    color: #ffffff;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

.profile-avatar:hover {
    transform: scale(1.05);
}

.profile-avatar:active {
    transform: scale(0.95);
}

/* Old filter/search bars - removed, using tabs + expandable search now */

/* ==========================================================================
   5. Bottom Bars and Controls
   ========================================================================== */

/* Controls bar - search and filter buttons */
.controls-bar {
    position: fixed;
    bottom: 70px;
    bottom: calc(70px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    height: 60px;
    background: transparent;
    border-top: none;
    display: none; /* Hidden by default, shown after app loads */
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    gap: 12px;
    z-index: 1000;
}

.control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.control-btn:hover {
    border-color: var(--accent-purple);
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Bottom bar with Add button */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    height: calc(70px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    backdrop-filter: blur(28px) saturate(180%);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: none; /* Hidden by default, shown after app loads */
    align-items: center;
    justify-content: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 999;
}

:root[data-theme="dark"] .bottom-bar {
    background: rgba(26, 15, 46, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.add-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-purple) 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.add-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.5);
}

.add-btn:active {
    transform: scale(0.95);
}

/* OLD STYLES - IGNORE */
.floating-control-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: fixed;
    bottom: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 1001;
    -webkit-tap-highlight-color: transparent;
}

.floating-control-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-purple);
}

.floating-control-btn:active {
    transform: scale(0.95);
}

#filterSortBtn {
    left: 20px;
    pointer-events: auto; /* Make button clickable */
}

#navSearch {
    right: 20px;
    pointer-events: auto; /* Make button clickable */
}

/* Centred FAB Add button - coloured gradient */
.fab-add-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-purple) 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
    position: fixed;
    bottom: 52px;
    bottom: calc(52px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto; /* Make button clickable */
}

.fab-add-btn:hover {
    transform: translateX(-50%) scale(1.08);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.5);
}

.fab-add-btn:active {
    transform: translateX(-50%) scale(0.95);
}

/* Floating panels - appear above controls bar */
.floating-panel {
    display: none;
    position: fixed;
    bottom: 140px;
    bottom: calc(140px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    backdrop-filter: blur(28px) saturate(180%);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    padding: 16px;
    min-width: 200px;
    border: 1px solid var(--border);
}

:root[data-theme="dark"] .floating-panel {
    background: rgba(26, 15, 46, 0.95);
}

.floating-panel.active {
    display: block;
    animation: slideIn 0.3s ease;
}

#filterSortPanel {
    left: 20px;
}

#searchBarExpandable {
    left: 20px;
    right: 20px;
    border-radius: 12px;
}

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

.floating-panel-content {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}

.close-panel-btn {
    background: none;
    border: none;
    outline: none;
    color: var(--text-secondary);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 8px;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.close-panel-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

:root[data-theme="dark"] .close-panel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 17px;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.panel-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.panel-option:hover {
    background: rgba(139, 92, 246, 0.1);
}

.panel-option svg {
    flex-shrink: 0;
}

/* ==========================================================================
   6. Bottom Navigation
   ========================================================================== */

/* Bottom bar - visual element beneath FAB */
.bottom-bar-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    height: calc(70px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    backdrop-filter: blur(28px) saturate(180%);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.04);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 999;
    pointer-events: none;
}

/* Dark mode frosted glass */
:root[data-theme="dark"] .app-header,

:root[data-theme="dark"] .app-header {
    border-bottom: none;
}

:root[data-theme="dark"] .bottom-bar-container {
    background: rgba(26, 15, 46, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Constrain bars to content width on desktop */
@media (min-width: 880px) {
    .controls-bar,
    .bottom-bar {
        left: calc(50% - 420px);
        right: calc(50% - 420px);
        width: 840px;
    }

    #filterSortPanel {
        left: calc(50% - 400px);
    }

    #searchBarExpandable {
        left: calc(50% - 400px);
        right: calc(50% - 400px);
    }
}

/* Sort menu dropdown */
.filter-menu {
    position: fixed;
    bottom: 165px;
    bottom: calc(165px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    padding: 8px;
    min-width: 200px;
    z-index: 1000;
}

.filter-menu-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.filter-menu-item:hover {
    background: var(--border);
}

.filter-menu-item.active {
    color: var(--accent-purple);
    font-weight: 600;
}

.filter-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.events-container {
    padding: 20px 20px 150px;
    padding-bottom: calc(150px + env(safe-area-inset-bottom));
    max-width: 800px;
    margin: 0 auto;
}

.event-card {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

:root[data-theme="dark"] .event-card {
    background: rgba(255, 255, 255, 0.05);
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.event-card.my-event {
    border-right: 4px solid var(--accent-purple);
}

.event-card.private-event {
    background: rgba(139, 92, 246, 0.05);
    border-right: 4px solid var(--accent-purple);
    border-style: dashed;
}

.event-card.clash {
    border-left: 4px solid #ef4444;
}

.event-date {
    display: none;
}

.event-day {
    display: none;
}

.event-month {
    display: none;
}

.event-end-date {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-pink);
    margin-top: 4px;
}

.event-details {
    flex: 1;
    min-width: 0;
}

.event-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text);
}

.event-location {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 4px 0;
}

.location-link {
    color: var(--accent-blue);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.location-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.event-time {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.event-description {
    font-size: 14px;
    color: var(--text);
    margin: 4px 0 0 0;
    line-height: 1.5;
}

.event-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.ticket-button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    background: var(--accent-blue);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ticket-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.star-button {
    padding: 8px 12px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    min-width: 70px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    font-size: 20px;
    margin-right: auto;
}

.star-button:focus {
    outline: none;
}

.star-button:hover {
    transform: scale(1.05);
}

.star-button.hearted {
    background: var(--bg);
    border-color: var(--border);
}

.star-button span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    min-width: 20px;
    text-align: left;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-hint {
    color: var(--accent-blue);
    font-size: 14px;
}

.error {
    text-align: center;
    padding: 40px;
    color: var(--accent-pink);
}

/* Navigation items */
.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.nav-item:hover {
    background: var(--border);
    color: var(--text);
}

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

.nav-add {
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-purple) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.nav-add:hover {
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-purple) 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
}

.nav-add:active {
    transform: scale(0.95);
}

/* ==========================================================================
   7. Modals
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg);
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    color: var(--text);
    flex: 1;
    min-width: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

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

.modal-content h2 {
    margin: 0 0 20px 0;
    color: var(--text);
}

.event-detail {
    margin: 12px 0;
    color: var(--text);
    line-height: 1.6;
}

.event-detail:empty {
    display: none;
}

.event-detail a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.event-detail a:hover {
    text-decoration: underline;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
}

.modal-actions button.full-width {
    width: 100%;
}

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

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text);
}

.settings-item {
    margin-bottom: 16px;
}

.settings-item label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.settings-value {
    font-size: 16px;
    color: var(--text);
    margin: 0;
}

.danger-button {
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    background: var(--accent-pink);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.danger-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.danger-button:active {
    transform: translateY(0);
}

/* ==========================================================================
   8. Responsive (Mobile)
   ========================================================================== */

@media (max-width: 600px) {
    body {
        padding: 16px;
    }

    .container {
        width: 100%;
        max-width: none;
        padding: 0;
    }

    h1 {
        font-size: 48px;
    }

    .logo {
        width: 120px;
        height: 120px;
        margin-bottom: 24px;
    }

    p {
        font-size: 16px;
        margin-bottom: 24px;
    }

    .auth-box {
        max-width: 100%;
        padding: 16px;
        margin-bottom: 20px;
    }

    .auth-input {
        font-size: 16px;
    }

    .auth-button {
        font-size: 16px;
    }

    .theme-toggle {
        font-size: 14px;
    }

    .app-header h1 {
        font-size: 20px;
    }

    .filter-button {
        padding: 10px 20px;
        font-size: 14px;
    }

    .event-card {
        flex-direction: column;
    }

    .event-date {
        width: auto;
        display: flex;
        gap: 12px;
        align-items: center;
    }

    .event-day {
        font-size: 28px;
    }

    .event-header {
        align-items: flex-start;
    }

    .event-title {
        font-size: 16px;
        line-height: 1.3;
    }

    .heart-button {
        margin-top: -4px;
    }
}
