/* ============================================
   AUDA-NEPAD Events App — Design System
   Version 2.0
   ============================================ */

/* ---------- Design Tokens ---------- */
:root {
    /* Surfaces */
    --surface-primary: #ffffff;
    --surface-secondary: #f8fafc;
    --surface-tertiary: #f1f5f9;
    --surface-elevated: #ffffff;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;

    /* Borders */
    --border-light: rgba(0, 0, 0, 0.06);
    --border-default: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Shadows — consistent elevation scale */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.10);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.14);

    /* Radius — only 3 values */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Spacing (4px base) */
    --space-0: 0;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Type scale */
    --text-2xs: 10px;
    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-md: 15px;
    --text-lg: 17px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 28px;

    /* Timing */
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);

    /* Z-index scale */
    --z-base: 1;
    --z-dropdown: 10;
    --z-sticky: 20;
    --z-overlay: 40;
    --z-modal: 50;
    --z-nav: 100;
    --z-toast: 200;
}

/* ---------- Base Reset & Global ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--surface-secondary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- App Shell ---------- */
.app-container {
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--surface-primary);
    position: relative;
    padding-bottom: 80px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.app-container::-webkit-scrollbar {
    display: none;
}

/* ---------- Card System ---------- */
.app-card {
    background: var(--surface-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    padding: var(--space-4);
    transition: box-shadow var(--duration-normal) var(--ease-out),
                transform var(--duration-normal) var(--ease-out);
}

.app-card:hover {
    box-shadow: var(--shadow-md);
}

.app-card:active {
    transform: scale(0.985);
}

.app-card--elevated {
    box-shadow: var(--shadow-md);
}

.app-card--flat {
    box-shadow: none;
    border: 1px solid var(--border-default);
}

.app-card--interactive {
    cursor: pointer;
}

.app-card--interactive:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.app-card--interactive:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-sm);
}

/* Grouped card (iOS-style list) */
.app-card-group {
    background: var(--surface-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.app-card-group__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    text-decoration: none;
    color: inherit;
    transition: background var(--duration-fast);
    border-bottom: 1px solid var(--border-light);
}

.app-card-group__item:last-child {
    border-bottom: none;
}

.app-card-group__item:hover {
    background: var(--surface-secondary);
}

.app-card-group__item:active {
    background: var(--surface-tertiary);
}

/* ---------- Section Headers ---------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-4);
    margin-bottom: var(--space-3);
}

.section-header__title {
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.section-header__action {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--event-primary, #498e8b);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 2px;
    transition: opacity var(--duration-fast);
}

.section-header__action:hover {
    opacity: 0.7;
}

/* Section label (uppercase small) */
.section-label {
    font-size: var(--text-2xs);
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 var(--space-4);
    margin-bottom: var(--space-2);
}

/* ---------- Icon Container ---------- */
.icon-box {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-box--sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.icon-box--lg {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
}

.icon-box--round {
    border-radius: var(--radius-full);
}

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-primary);
    border-top: 1px solid var(--border-default);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: var(--z-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
    cursor: pointer;
    transition: color var(--duration-fast);
    text-decoration: none;
    color: var(--text-tertiary);
    flex: 1;
    position: relative;
}

.nav-item.active {
    color: var(--event-primary, #498e8b);
}

.nav-item svg {
    margin-bottom: 2px;
}

.nav-icon {
    width: 22px;
    height: 22px;
    max-width: 22px;
    max-height: 22px;
    margin-bottom: 2px;
}

.nav-item span {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
}

/* ---------- Gradient Header ---------- */
.gradient-header {
    background: linear-gradient(135deg, var(--event-primary) 0%, var(--event-secondary) 100%);
    position: relative;
    color: #ffffff;
}

/* ---------- Badge / Pill ---------- */
.app-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-2xs);
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    line-height: 1.3;
}

.app-badge--primary {
    background: var(--event-primary, #498e8b);
    color: var(--text-inverse);
}

.app-badge--muted {
    background: var(--surface-tertiary);
    color: var(--text-secondary);
}

.app-badge--live {
    background: #22c55e;
    color: #ffffff;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

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

.animate-fade-in-up {
    animation: fadeInUp 0.5s var(--ease-out) forwards;
    opacity: 0;
}

.animate-fade-in {
    animation: fadeIn 0.3s var(--ease-out) forwards;
    opacity: 0;
}

/* Stagger children */
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.10s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.20s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.30s; }

/* Active press effect */
.active\:scale-98:active {
    transform: scale(0.98);
}

/* ---------- Banner / Carousel ---------- */
.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: var(--space-5);
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.banner-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.banner-dot {
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
}

.banner-dot.active {
    opacity: 1 !important;
    transform: scale(1.3);
}

/* ---------- Urgency Banner ---------- */
@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

.animate-pulse-slow {
    animation: pulse-slow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ---------- Scrollbar Hiding ---------- */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------- Stat Cards ---------- */
.stat-card {
    animation: fadeInUp 0.6s var(--ease-out) forwards;
    opacity: 0;
}
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* ---------- Speaker Slider ---------- */
.speaker-indicator {
    transition: all var(--duration-normal) var(--ease-out);
}

.speaker-indicator.active {
    background-color: var(--event-primary, #498e8b);
    width: 24px;
}

/* ---------- "Right Now" Session Card ---------- */
.right-now-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: var(--space-4);
    color: var(--text-inverse);
}

.right-now-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.08;
    background-image: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.3) 0%, transparent 50%);
    pointer-events: none;
}

/* ---------- Quick Action Grid ---------- */
.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-4) var(--space-2);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
}

.quick-action:active {
    transform: scale(0.95);
}

.quick-action__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-2);
    transition: transform var(--duration-normal) var(--ease-out);
}

.quick-action:hover .quick-action__icon {
    transform: scale(1.08);
}

.quick-action__label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.quick-action__count {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ---------- Feed / Timeline ---------- */
.feed-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    transition: background var(--duration-fast);
}

.feed-item:last-child {
    border-bottom: none;
}

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

.feed-item__time {
    font-size: var(--text-2xs);
    font-weight: 600;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* ---------- Divider ---------- */
.app-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-default), transparent);
    margin: var(--space-4) var(--space-4);
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
}

.empty-state__icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--surface-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-3);
}

.empty-state__title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}

.empty-state__description {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* ---------- Legacy Support ---------- */
/* Keep curved-card for pages not yet migrated */
.curved-card {
    background: var(--surface-primary);
    border-radius: var(--radius-xl);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 14px;
}
