@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;600;700&family=Nunito:wght@400;600;700;800&display=swap');

:root {
    --primary:       #7C5CBF;
    --primary-light: #9B7FD4;
    --primary-dark:  #5A3E9B;
    --accent:        #F5A623;
    --surface:       #FFFFFF;
    --surface-2:     #F7F5FB;
    --surface-3:     #EDE9F7;
    --border:        #D9D1F0;
    --text:          #1A1230;
    --text-muted:    #6B5F8A;
    --danger:        #D0021B;
    --success:       #2E7D32;
    --radius:        12px;
    --radius-sm:     8px;
    --shadow:        0 2px 12px rgba(124,92,191,0.10);
    --shadow-md:     0 4px 24px rgba(124,92,191,0.15);
    --font-display:  'Lora', Georgia, serif;
    --font-body:     'Nunito', sans-serif;
    --transition:    0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: var(--font-body); font-size: 18px; color: var(--text); background: var(--surface-2); min-height: 100vh; -webkit-font-smoothing: antialiased; }

.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.top-nav { background: linear-gradient(to right, #ffffff 0%, #ffffff 8%, var(--primary) 38%, var(--primary) 100%); color: #fff; padding: 0 1.25rem; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(90,62,155,0.25); }
.top-nav .brand { font-family: var(--font-display); font-size: 0.35rem; font-weight: 700; color: #fff; text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.page-body { flex: 1; max-width: 1200px; margin: 0 auto; width: 100%; padding: 1.5rem 1.25rem; }

.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.6rem 1.35rem; border-radius: var(--radius-sm); font-family: var(--font-body); font-weight: 700; font-size: 1rem; border: none; cursor: pointer; transition: all var(--transition); text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); background: var(--surface-3); }
.btn-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.4); }
.btn-ghost:hover { background: rgba(255,255,255,0.15); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.45rem 0.95rem; font-size: 0.9rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }
.btn-attend { background: var(--surface-3); color: var(--primary); border: 2px solid var(--primary); }
.btn-attend:hover { background: var(--primary); color: #fff; }
.btn-attending { background: var(--primary); color: #fff; border: 2px solid var(--primary); }
.btn-attending:hover { background: var(--danger); border-color: var(--danger); }

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

.event-card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; transition: all var(--transition); overflow: hidden; }
.event-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.event-card-accent { height: 5px; }
.event-card-body { padding: 1rem 1.1rem 0.75rem; flex: 1; }
.event-category-badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.82rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
.event-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--text); margin-bottom: 0.3rem; line-height: 1.3; }
.event-meta { font-size: 0.9rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.5rem; }
.event-desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.event-card-footer { padding: 0.65rem 1.1rem; border-top: 1px solid var(--border); background: var(--surface-2); display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.attendee-count { font-size: 0.9rem; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 0.3rem; }
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.category-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.85rem; border-radius: 20px; font-size: 0.82rem; font-weight: 700; cursor: pointer; border: 2px solid var(--border); transition: all var(--transition); background: var(--surface); color: var(--text-muted); }
.category-chip:hover { border-color: var(--primary); color: var(--primary); }

.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-weight: 700; font-size: 0.95rem; color: var(--text); margin-bottom: 0.35rem; }
.form-control { width: 100%; padding: 0.75rem 1rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 1rem; color: var(--text); background: var(--surface); transition: border-color var(--transition), box-shadow var(--transition); outline: none; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,92,191,0.15); }
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237C5CBF' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }

.page-header { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; border-radius: var(--radius); padding: 1.5rem 1.5rem 1.25rem; margin-bottom: 1.5rem; }
.page-header h1 { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; margin-bottom: 0.3rem; }
.page-header p { opacity: 0.85; font-size: 1.05rem; }

.comment-item { display: flex; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-light); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; overflow: hidden; }
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.2rem; }
.comment-meta strong { color: var(--text); font-weight: 700; }
.comment-text { font-size: 1rem; line-height: 1.5; }

.alert { padding: 0.85rem 1.1rem; border-radius: var(--radius-sm); font-size: 1rem; margin-bottom: 1rem; }
.alert-error   { background: #FFF0F0; color: var(--danger); border: 1px solid #FFCDD2; }
.alert-success { background: #F0FFF4; color: var(--success); border: 1px solid #C8E6C9; }
.alert-info    { background: var(--surface-3); color: var(--primary); border: 1px solid var(--border); }

.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; justify-content: center; padding: 3rem 0; }

.login-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; gap: 1.25rem; }
.login-logo { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; color: var(--primary); }
.login-tagline { color: var(--text-muted); max-width: 340px; line-height: 1.6; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state h3 { font-family: var(--font-display); color: var(--text); margin-bottom: 0.5rem; }

.search-wrap { position: relative; margin-bottom: 1rem; }
.search-wrap input { padding-left: 2.5rem; }
.search-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

.detail-hero { border-radius: var(--radius); overflow: hidden; margin-bottom: 1.25rem; }
.detail-hero-banner { height: 8px; }
.detail-hero-body { padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-top: none; }
.detail-title { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.25; }
.detail-meta-row { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.97rem; color: var(--text-muted); margin-bottom: 1.1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.detail-meta-row span { display: flex; align-items: center; gap: 0.3rem; }

.profile-wrap { max-width: 480px; margin: 0 auto; }
.avatar-large { width: 80px; height: 80px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; margin: 0 auto 1rem; overflow: hidden; }
.avatar-large img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 600px) {
    .page-body { padding: 1rem 0.75rem; }
    .events-grid { grid-template-columns: 1fr; }
    .detail-title { font-size: 1.5rem; }
}
