/* Custom Color Tokens & Layout Variables — Morandi Palette */
:root {
    /* Primary: Morandi dusty teal-blue */
    --primary-hsl: 205, 22%, 52%;
    --primary: hsl(var(--primary-hsl));         /* ≈ #6D8EA0 */
    --primary-hover: hsl(205, 22%, 41%);

    /* Secondary: very light sage wash */
    --secondary-hsl: 150, 12%, 91%;
    --secondary: hsl(var(--secondary-hsl));     /* ≈ #E5EDE7 */

    /* Accent: warm dusty rose */
    --accent-hsl: 4, 20%, 64%;
    --accent: hsl(var(--accent-hsl));           /* ≈ #C09D9B */
    --accent-hover: hsl(4, 20%, 52%);

    /* Functional — all muted, Morandi-style */
    --success: #728A7A;         /* Morandi sage green — available/open */
    --success-hover: #597A69;
    --danger: #A07878;          /* Morandi dusty rose-red */
    --warning: #B09279;         /* Morandi warm sienna-brown */

    /* Backgrounds */
    --bg-main: #F2EEEA;         /* Warm linen */
    --bg-card: #FDFCFB;         /* Near-white with warmth */
    --bg-header: rgba(253, 252, 251, 0.92);

    /* Text */
    --text-primary: #3D3835;    /* Dark warm gray-brown */
    --text-secondary: #6B6260;  /* Medium warm gray */
    --text-muted: #9E9290;      /* Muted warm gray */

    /* Borders */
    --border-color: rgba(140, 115, 111, 0.13);
    --border-focus: rgba(109, 142, 160, 0.38);

    /* Shadows */
    --card-shadow: 0 4px 20px rgba(100, 80, 70, 0.07);
    --hover-shadow: 0 14px 36px rgba(100, 80, 70, 0.14);

    /* Typography */
    --font-heading: 'Outfit', 'Inter', 'Noto Sans TC', sans-serif;
    --font-body: 'Inter', 'Noto Sans TC', sans-serif;

    /* Shape & Motion */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Overrides — Morandi warm charcoal */
body.dark-theme {
    --primary-hsl: 205, 28%, 63%;
    --primary: hsl(var(--primary-hsl));
    --primary-hover: hsl(205, 28%, 73%);

    --secondary-hsl: 150, 10%, 22%;
    --secondary: hsl(var(--secondary-hsl));

    --bg-main: #1E1C1A;
    --bg-card: #27231E;
    --bg-header: rgba(30, 28, 26, 0.94);

    --text-primary: #E8E4DF;
    --text-secondary: #B5AFA9;
    --text-muted: #7A746E;

    --border-color: rgba(200, 180, 165, 0.10);
    --border-focus: rgba(140, 170, 190, 0.35);

    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
    --hover-shadow: 0 14px 36px rgba(0, 0, 0, 0.40);
}

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

html {
    scroll-behavior: smooth;
    font-size: 17px;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition);
}

.hide {
    display: none !important;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* App Header styling */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

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

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
}

.logo-img {
    height: 44px;
    width: auto;
    object-fit: contain;
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-text .subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    font-weight: 500;
    text-transform: uppercase;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.main-nav {
    display: flex;
    background: rgba(30, 58, 138, 0.05);
    padding: 4px;
    border-radius: var(--radius-md);
}

.nav-btn {
    border: none;
    outline: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.nav-btn:hover {
    color: var(--primary);
}

.nav-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.08);
}

.lang-toggle-btn, .theme-toggle-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    padding: 0 12px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.lang-toggle-btn:hover, .theme-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(109, 142, 160, 0.10);
}

.zoom-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 2px;
    height: 38px;
    transition: var(--transition);
}

.zoom-controls:hover {
    border-color: var(--primary);
}

.zoom-btn {
    border: none;
    background: transparent;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: var(--transition);
}

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

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

/* App Main Content layout */
.main-content {
    max-width: 1400px;
    margin: 88px auto 0 auto;
    padding: 24px;
    min-height: calc(100vh - 150px);
}

.portal-section {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.portal-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Hero Banner */
.hero-banner {
    position: relative;
    border-radius: var(--radius-lg);
    background: linear-gradient(140deg, #4A6B7A 0%, #5F7E8E 35%, #728A7A 75%, #597A69 100%);
    color: white;
    padding: 60px 40px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(90, 122, 140, 0.22);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 80% 20%, rgba(235, 230, 220, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 750px;
}

.hero-content h2 {
    font-family: var(--font-heading);
    font-size: 2.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    line-height: 1.3;
}
.hero-content p {
    font-size: 1.05rem;
    opacity: 0.9;
    margin-bottom: 28px;
    font-weight: 300;
}

/* Search Box styling */
.search-container {
    width: 100%;
    max-width: 580px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    padding: 4px 16px;
    transition: var(--transition);
}

.search-box:focus-within {
    background: white;
    border-color: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.search-box:focus-within input {
    color: #2C3C40;
}

.search-box:focus-within .search-icon {
    color: var(--primary);
}

.search-icon {
    color: white;
    margin-right: 12px;
    transition: var(--transition);
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    padding: 10px 0;
    color: white;
    font-size: 0.95rem;
    font-family: var(--font-body);
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box input:focus::placeholder {
    color: var(--text-muted);
}

.clear-search-btn {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 1.3rem;
    padding: 0 4px 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.clear-search-btn.hide {
    display: none !important;
}

.clear-search-btn:hover {
    color: white;
    transform: scale(1.1);
}

.search-box:focus-within .clear-search-btn {
    color: var(--text-muted);
}

.search-box:focus-within .clear-search-btn:hover {
    color: var(--primary);
}

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

.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary);
}

.stat-num {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Content Layout (Sidebar + Grid) */
.content-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.filter-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 88px;
    z-index: 100;
    transition: var(--transition);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 4px;
}

.filter-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-header h3 svg {
    color: var(--primary);
}

.filter-group {
    position: relative;
}

.filter-group-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.25s ease;
    user-select: none;
}

.filter-group-header:hover {
    background: rgba(114, 138, 122, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

.filter-group-header .arrow {
    display: inline-block;
    transition: transform 0.25s ease;
    font-size: 0.75rem;
}

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

.filter-group.active .filter-group-header .arrow {
    transform: rotate(180deg);
}

.filter-options {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--hover-shadow);
    padding: 16px;
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.filter-group.active .filter-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-secondary);
    padding: 2px 0;
    transition: var(--transition);
}

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

.filter-option input[type="checkbox"] {
    display: none;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    border: 1px solid var(--text-muted);
    border-radius: 4px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    background: var(--bg-card);
}

.filter-option input[type="checkbox"]:checked + .custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.filter-option input[type="checkbox"]:checked + .custom-checkbox::after {
    content: '';
    width: 9px;
    height: 5px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg) translate(1px, -1px);
}

.filter-option input[type="checkbox"]:checked ~ .filter-name {
    color: var(--primary);
    font-weight: 600;
}

/* Active Tags Bar */
.active-tags-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 10px 16px;
    background: rgba(114, 138, 122, 0.06);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}

.tags-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    background: var(--primary);
    color: white;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tag-item button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

/* Event Grid and Cards */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.event-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition);
}

.event-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary);
}

.card-header-img {
    min-height: 170px;
    height: auto;
    position: relative;
    background: linear-gradient(140deg, #4E7084 0%, #6D8EA0 100%); /* Morandi teal — open */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 44px 20px 20px 20px;
    transition: var(--transition);
}

.card-title-overlay {
    font-family: var(--font-heading);
    font-size: 1.12rem;
    font-weight: 700;
    color: white;
    text-align: center;
    line-height: 1.45;
    margin: 0;
    z-index: 3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-header-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.05);
}

.card-cat-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.card-status-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    color: white;
    z-index: 2;
}

.card-status-badge.open {
    background: var(--secondary);
    color: var(--primary);
    border: 1px solid rgba(30, 58, 138, 0.15);
}

.card-status-badge.full {
    background: var(--warning);
}

.card-status-badge.closed {
    background: var(--text-muted);
}

/* Card state distinction by status */
.event-card--full .card-header-img {
    background: linear-gradient(140deg, #8E7070 0%, #C09D9B 100%); /* Morandi dusty rose */
}
.event-card--full .card-body {
    background: rgba(192, 157, 155, 0.04);
}
.event-card--full .card-footer {
    border-top-color: rgba(192, 157, 155, 0.2);
}

.event-card--closed .card-header-img {
    background: linear-gradient(140deg, #6B7580 0%, #93939B 100%); /* Morandi cool gray */
}
.event-card--closed {
    opacity: 0.80;
}
.event-card--closed:hover {
    opacity: 0.92;
}
.event-card--closed .card-body {
    background: rgba(147, 147, 155, 0.03);
}

.event-card--upcoming .card-header-img {
    background: linear-gradient(140deg, #5B7582 0%, #B09279 100%); /* Morandi teal to warm sienna */
}
.event-card--upcoming .card-body {
    background: rgba(176, 146, 121, 0.02);
}
.card-status-badge.upcoming {
    background: var(--warning);
    color: white;
    border: 1px solid rgba(176, 146, 121, 0.2);
}

/* Non-registration Card Morandi Gray-Green Theme */
.card-non-register .card-header-img {
    background: linear-gradient(140deg, #5C756B 0%, #8EA399 100%); /* Morandi gray-green */
}
.card-non-register .card-body {
    background: var(--bg-card); /* Same background color as other cards */
}
body.dark-theme .card-non-register .card-body {
    background: var(--bg-card); /* Same dark background color as other cards */
}
.card-non-register .card-status-badge.open {
    background: #4A5343; /* Dark Olive Hojicha Green */
    color: #FFFFFF;
    border: 1px solid rgba(74, 83, 67, 0.4);
}
body.dark-theme .card-non-register .card-status-badge.open {
    background: #4A5343;
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.card-non-register:hover {
    border-color: #789084 !important;
}
.card-non-register .btn-primary {
    background: #8EA399 !important; /* Lighter Morandi gray-green (matching header color family) */
    color: #FFFFFF !important;
    border: none !important;
}
.card-non-register .btn-primary:hover:not(:disabled) {
    background: #768B81 !important; /* Hover slightly darker */
    box-shadow: 0 4px 15px rgba(142, 163, 153, 0.30) !important;
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-meta-item svg {
    color: var(--primary);
}

.card-event-time {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding: 6px 12px;
    background: hsla(var(--primary-hsl), 0.1);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}

.card-event-time svg {
    color: var(--primary);
    flex-shrink: 0;
}

.card-body h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3.2em; /* Keeps layout aligned */
}

.card-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3.0em;
}

.card-corrupted-remnants {
    line-height: 1.5;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3.0em;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.card-seats-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.seats-count {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary);
}

/* Button variants */
.btn {
    border: none;
    outline: none;
    border-radius: var(--radius-sm);
    padding: 9px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(109, 142, 160, 0.22);
}

.btn-secondary {
    background: rgba(109, 142, 160, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(109, 142, 160, 0.11);
}

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

.btn-success:hover {
    background: var(--success-hover);
    box-shadow: 0 4px 15px rgba(114, 138, 122, 0.22);
}

.btn:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* No Results Views */
.no-results-view, .empty-state-view {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.no-results-view h4, .empty-state-view h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 600;
}

.no-results-view p, .empty-state-view p {
    font-size: 0.85rem;
    max-width: 350px;
}

/* ORGANIZER PORTAL (BACKEND) STYLING */
.organizer-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.organizer-header-row h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.organizer-header-row p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.dash-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.dash-stat-card .card-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--primary);
    opacity: 0.15;
    transform: scale(1.6);
}

.dash-stat-card .card-value {
    font-size: 2.1rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 6px;
}

.dash-stat-card .card-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Double Columns Layout */
.dashboard-content-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
}

.dashboard-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.dashboard-sidebar .sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 58, 138, 0.02);
}

.dashboard-sidebar .sidebar-header h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.badge {
    background: var(--primary);
    color: white;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.dashboard-event-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dash-event-item {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dash-event-item:hover {
    background: rgba(109, 142, 160, 0.06);
}

.dash-event-item.active {
    background: rgba(30, 58, 138, 0.05);
    border-color: var(--border-focus);
}

.dash-event-item h5 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dash-event-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.dash-event-item-meta .signup-count {
    font-weight: 600;
    color: var(--primary);
}

/* Detail Panel on Right */
.dashboard-detail-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    padding: 24px;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent grid item from expanding beyond 1fr */
}

.no-event-selected {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    gap: 12px;
}

.no-event-selected h4 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 600;
}

.selected-event-detail {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-grow: 1;
    min-width: 0; /* Allow flex child to shrink so inner table-container can scroll */
    overflow-x: auto; /* Horizontal scroll fallback for the whole detail area */
}

.detail-header-info {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.detail-header-info h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 8px 0;
}

.detail-header-info .tags-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.registration-list-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box-sm {
    display: flex;
    align-items: center;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px 12px;
    width: 320px;
    transition: var(--transition);
}

.search-box-sm:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--border-focus);
}

.search-box-sm input {
    border: none;
    outline: none;
    background: transparent;
    padding: 8px 0;
    font-size: 0.85rem;
    width: 100%;
    margin-left: 8px;
    color: var(--text-primary);
}

.search-box-sm input::placeholder {
    color: var(--text-muted);
}

/* Participant Data Table */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    margin-bottom: 20px;
    flex-grow: 1;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.data-table th {
    background: rgba(114, 138, 122, 0.05);
    color: var(--text-primary);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    white-space: nowrap;
}

.data-table tr:hover td {
    background: rgba(30, 58, 138, 0.01);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.badge-credit-yes {
    background: rgba(42, 157, 143, 0.1);
    color: var(--success);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.badge-credit-no {
    background: rgba(86, 106, 110, 0.1);
    color: var(--text-secondary);
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
}

.btn-icon-danger {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-danger:hover {
    color: var(--danger);
    background: rgba(231, 111, 81, 0.1);
}

/* MODAL GENERAL STYLING */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 17, 19, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 700px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-content.max-w-lg {
    max-width: 880px;
}

/* Dashboard Event Filters */
.dashboard-event-filters .filter-item select,
.dashboard-event-filters .filter-item input {
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition);
}

.dashboard-event-filters .filter-item select:focus,
.dashboard-event-filters .filter-item input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--border-focus);
}

.modal-backdrop.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 58, 138, 0.02);
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

.btn-close-modal:hover {
    color: var(--text-primary);
    background: rgba(30, 58, 138, 0.05);
}

.modal-body {
    margin-top: 6px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-secondary);
    position: relative;
    user-select: none;
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.custom-radio {
    height: 18px;
    width: 18px;
    background-color: var(--bg-card);
    border: 1px solid var(--text-muted);
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
    position: relative;
    transition: var(--transition);
}

.radio-label:hover input ~ .custom-radio {
    border-color: var(--primary);
}

.radio-label input:checked ~ .custom-radio {
    background-color: var(--primary);
    border-color: var(--primary);
}

.radio-label input:checked ~ .custom-radio::after {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Toast Notifications styling */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}

.toast {
    background: var(--bg-card);
    color: var(--text-primary);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-msg {
    font-size: 0.85rem;
    font-weight: 500;
}

.toast.success {
    border-left-color: var(--success);
}
.toast.success svg {
    color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}
.toast.error svg {
    color: var(--danger);
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 700;
}

/* Footer Section */
.app-footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 20px;
    text-align: center;
    margin-top: 40px;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
    .filter-sidebar {
        position: static;
    }
    .dashboard-content-layout {
        grid-template-columns: 1fr;
    }
    .dashboard-sidebar {
        height: auto;
        max-height: 250px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
    }
    .nav-controls {
        justify-content: space-between;
    }
    .stats-bar, .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .hero-banner {
        padding: 40px 20px;
    }
    .hero-content h2 {
        font-size: 1.8rem;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Mobile Accordion Filter Overrides */
    .filter-sidebar {
        display: flex;
        flex-direction: column;
        gap: 12px;
        position: static;
        width: 100%;
        padding: 16px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
    }

    .filter-options {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--border-color);
        border-radius: 0;
        margin-top: 0;
        padding: 12px 8px 4px 8px;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
    }

    .filter-group.active .filter-options {
        display: flex;
    }
}

/* Organizer Login View Styles */
.organizer-login-view {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
    min-height: 480px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--hover-shadow);
    width: 100%;
    max-width: 400px;
    padding: 40px 30px;
    text-align: center;
    transition: var(--transition);
}

.login-card:hover {
    border-color: var(--primary);
}

.login-icon {
    width: 72px;
    height: 72px;
    background: rgba(30, 58, 138, 0.05);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
}

.login-card h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.login-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.btn-toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: var(--transition);
}

.btn-toggle-pw:hover {
    color: var(--primary);
}

/* Shake Animation for incorrect password */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

.modal-lang-toggle-btn:hover {
    background: rgba(30, 58, 138, 0.12) !important;
    color: var(--accent) !important;
    transform: scale(1.02);
}

/* ══ RESTORED & PRIVACY NOTICE — appended to override corruption ══ */

/* Restore .modal-body */
.modal-body {
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
}

/* Restore .modal-event-summary */
.modal-event-summary {
    background: rgba(109, 142, 160, 0.05);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    box-shadow: none;
}



.modal-event-summary h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 6px 0;
}

.modal-event-meta {
    display: flex;
    gap: 16px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.modal-event-meta div {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Restore form layout */
.form-group { margin-bottom: 18px; }
.form-row { display: flex; gap: 16px; }
.flex-1 { flex: 1; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-group label.required::after {
    content: ' *';
    color: var(--danger);
    font-weight: 700;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: var(--font-body);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--border-focus);
}

/* Restore .radio-group */
.radio-group { display: flex; gap: 20px; margin-top: 6px; }

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-secondary);
    position: relative;
    user-select: none;
}

/* ── Privacy Notice Section ──────────────────────────────── */
.privacy-notice-section { margin-bottom: 20px; }

.privacy-summary-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(109, 142, 160, 0.07);
    border: 1px solid rgba(109, 142, 160, 0.18);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 0.83rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.privacy-icon { font-size: 1rem; margin-top: 1px; flex-shrink: 0; opacity: 0.80; }

.privacy-text strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.privacy-full-details { margin-top: 2px; }

.privacy-full-summary {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.80rem;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: var(--transition);
    list-style: none;
    user-select: none;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}
.privacy-full-summary::-webkit-details-marker, .privacy-full-summary::marker { display: none; }
.privacy-full-summary:hover {
    background: rgba(109, 142, 160, 0.09);
    border-color: rgba(109, 142, 160, 0.22);
    text-decoration: none;
}
.privacy-full-summary svg { transition: transform 0.28s ease; flex-shrink: 0; }
.privacy-full-details[open] .privacy-full-summary svg { transform: rotate(180deg); }

.privacy-full-content {
    margin-top: 8px;
    padding: 16px 18px;
    background: rgba(109, 142, 160, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.80rem;
    line-height: 1.75;
    color: var(--text-secondary);
    max-height: 300px;
    overflow-y: auto;
    animation: privacySlideIn 0.25s ease;
}

@keyframes privacySlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.privacy-content-title {
    font-size: 0.84rem !important;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px !important;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}
.privacy-full-content p { margin-bottom: 7px; }
.privacy-full-content strong { color: var(--text-primary); }
.privacy-list { padding-left: 18px; margin: 4px 0 8px; }
.privacy-list li { margin-bottom: 4px; }
.privacy-note {
    margin-top: 10px !important;
    padding: 7px 10px;
    background: rgba(140, 115, 111, 0.07);
    border-radius: 4px;
    font-size: 0.77rem;
    color: var(--text-muted);
    font-style: italic;
}

/* --- Attendance & Satisfaction Survey Styles --- */
.rating-item {
    background: rgba(30, 58, 138, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: var(--transition);
}
.rating-item:hover {
    background: rgba(30, 58, 138, 0.02);
    border-color: rgba(30, 58, 138, 0.15);
}
.rating-options {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.rating-options label {
    flex: 1;
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--border-color);
    padding: 10px 6px;
    border-radius: 6px;
    background: var(--bg-card);
    transition: all 0.2s ease;
    user-select: none;
}
.rating-options label:hover {
    background: rgba(109, 142, 160, 0.08);
    border-color: rgba(109, 142, 160, 0.3);
    transform: translateY(-2px);
}
.rating-options label:active {
    transform: translateY(0);
}
.rating-options label:has(input[type="radio"]:checked) {
    background: var(--primary);
    border-color: var(--primary);
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(30, 58, 138, 0.2);
}
.rating-options label:has(input[type="radio"]:checked) * {
    color: white !important;
}
.rating-number {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}
.rating-desc {
    font-size: 0.62rem;
    color: var(--text-muted);
    line-height: 1.2;
}

/* Tool Subcard Styling */
.tool-subcard {
    transition: var(--transition);
}
.tool-subcard:hover {
    border-color: rgba(109, 142, 160, 0.35) !important;
    background: rgba(109, 142, 160, 0.02) !important;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.02);
}

/* Collapsible Feedbacks Container */
#panel-survey-feedbacks {
    transition: all 0.3s ease;
}
#panel-survey-feedbacks ul li {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}
#panel-survey-feedbacks ul li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Responsive adjustment for Mobile screens */
@media (max-width: 576px) {
    .rating-options {
        flex-direction: column;
        gap: 6px;
    }
    .rating-options label {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 16px;
        padding: 8px 16px;
        text-align: left;
    }
    .rating-options label:hover {
        transform: none;
    }
    .rating-number {
        font-size: 1rem;
        margin-bottom: 0;
    }
    .rating-desc {
        text-align: left;
        white-space: nowrap;
    }
}
