html {
    scroll-behavior: smooth;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(25, 227, 50, 0.3); }
    50% { box-shadow: 0 0 16px 4px rgba(25, 227, 50, 0.15); }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease both;
}
.fade-in {
    animation: fadeIn 0.45s ease both;
}
.fade-in-scale {
    animation: fadeInScale 0.4s ease both;
}

.stagger-1 { animation-delay: 0.04s; }
.stagger-2 { animation-delay: 0.08s; }
.stagger-3 { animation-delay: 0.12s; }
.stagger-4 { animation-delay: 0.16s; }
.stagger-5 { animation-delay: 0.20s; }
.stagger-6 { animation-delay: 0.24s; }
.stagger-7 { animation-delay: 0.28s; }
.stagger-8 { animation-delay: 0.32s; }

.scroll-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.scroll-reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

.main-nav {
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-link {
    transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease !important;
}
.nav-link:active {
    transform: scale(0.97);
}

.nav-sign-in {
    transition: all 0.2s ease !important;
}
.nav-sign-in:active {
    transform: scale(0.96);
}

.nav-avatar {
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
}
.nav-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(25, 227, 50, 0.15);
}

button, .btn, [role="button"], input[type="submit"] {
    transition: all 0.2s ease;
}
button:active, .btn:active, [role="button"]:active, input[type="submit"]:active {
    transform: scale(0.97);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    border: 1px solid #27272a;
    border-radius: 8px;
    color: #a1a1aa;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.25s ease !important;
}
.theme-toggle:hover { border-color: #19E332; color: #19E332; }
.theme-toggle:active {
    transform: scale(0.88) rotate(15deg);
}
.theme-toggle .moon-icon { display: none; }
body.light-mode .theme-toggle .sun-icon { display: none; }
body.light-mode .theme-toggle .moon-icon { display: block; }
body.light-mode .theme-toggle {
    background: #f4f4f5;
    border-color: #e4e4e7;
    color: #71717a;
}
body.light-mode .theme-toggle:hover { border-color: #19E332; color: #19E332; }

.client-notif-bell {
    transition: all 0.2s ease !important;
}
.client-notif-bell:active {
    transform: scale(0.9);
}

.client-notif-dropdown {
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform-origin: top right;
}
.client-notif-dropdown:not(.open) {
    opacity: 0;
    transform: scale(0.95) translateY(-4px);
    pointer-events: none;
}
.client-notif-dropdown.open {
    opacity: 1;
    transform: scale(1) translateY(0);
    display: block !important;
}

.mobile-sidebar {
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.mobile-sidebar-overlay {
    transition: opacity 0.3s ease !important;
    opacity: 0;
}
.mobile-sidebar-overlay.open {
    opacity: 1;
}

.hamburger-btn span {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

body {
    transition: background-color 0.35s ease, color 0.35s ease;
}
body.light-mode .main-nav,
.main-nav {
    transition: background 0.35s ease, border-color 0.35s ease;
}

a {
    transition: color 0.2s ease;
}

img {
    transition: opacity 0.3s ease;
}
img[loading="lazy"] {
    opacity: 0;
}
img[loading="lazy"].loaded,
img[loading="lazy"][complete] {
    opacity: 1;
}

input, textarea, select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(25, 227, 50, 0.1);
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #18181b 25%, #27272a 50%, #18181b 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 8px;
}
body.light-mode .skeleton-shimmer {
    background: linear-gradient(90deg, #f4f4f5 25%, #e4e4e7 50%, #f4f4f5 75%);
    background-size: 800px 100%;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}
body.light-mode ::-webkit-scrollbar-thumb {
    background: #d4d4d8;
}
body.light-mode ::-webkit-scrollbar-thumb:hover {
    background: #a1a1aa;
}

::selection {
    background: rgba(25, 227, 50, 0.25);
    color: #fafafa;
}
body.light-mode ::selection {
    background: rgba(25, 227, 50, 0.2);
    color: #18181b;
}

.opah-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.opah-toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 420px;
    padding: 14px 20px 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    font-family: inherit;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #18181b;
    color: #fafafa;
    border: 1px solid #27272a;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.opah-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.opah-toast.hiding {
    transform: translateX(120%);
    opacity: 0;
}

.opah-toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    margin-top: 1px;
}

.opah-toast.success .opah-toast-icon {
    background: #19E332;
    color: #09090b;
}

.opah-toast.error .opah-toast-icon {
    background: #ef4444;
    color: #fff;
}

.opah-toast.warning .opah-toast-icon {
    background: #f59e0b;
    color: #09090b;
}

.opah-toast.info .opah-toast-icon {
    background: #3b82f6;
    color: #fff;
}

.opah-toast.success {
    border-color: rgba(25, 227, 50, 0.25);
}

.opah-toast.error {
    border-color: rgba(239, 68, 68, 0.25);
}

.opah-toast.warning {
    border-color: rgba(245, 158, 11, 0.25);
}

.opah-toast.info {
    border-color: rgba(59, 130, 246, 0.25);
}

.opah-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #71717a;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    margin-left: auto;
    transition: color 0.15s;
}

.opah-toast-close:hover {
    color: #fafafa;
}

.opah-toast-msg {
    flex: 1;
}

.opah-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 0 0 12px 12px;
    background: rgba(255,255,255,0.15);
    transition: width linear;
}

.opah-toast.success .opah-toast-progress { background: rgba(25, 227, 50, 0.4); }
.opah-toast.error .opah-toast-progress { background: rgba(239, 68, 68, 0.4); }
.opah-toast.warning .opah-toast-progress { background: rgba(245, 158, 11, 0.4); }
.opah-toast.info .opah-toast-progress { background: rgba(59, 130, 246, 0.4); }

body.light-mode .opah-toast {
    background: #ffffff;
    color: #18181b;
    border-color: #e4e4e7;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
}

body.light-mode .opah-toast-close { color: #a1a1aa; }
body.light-mode .opah-toast-close:hover { color: #18181b; }
body.light-mode .opah-toast.success { border-color: rgba(25, 227, 50, 0.3); }
body.light-mode .opah-toast.error { border-color: rgba(239, 68, 68, 0.3); }
body.light-mode .opah-toast.warning { border-color: rgba(245, 158, 11, 0.3); }
body.light-mode .opah-toast.info { border-color: rgba(59, 130, 246, 0.3); }

/* ═══════════════════════════════════════════════════════════
   LIGHT MODE — GLOBAL OVERRIDES
   Applied via body.light-mode (added by opah-polish.js on load)
   Higher specificity than plain element/class rules in page <style>
   ═══════════════════════════════════════════════════════════ */

/* ── Foundation: body background + text + CSS variable overrides ── */
body.light-mode {
    background-color: #ffffff;
    color: #18181b;
    /* CSS variable system — covers pages that use var(--bg) etc. */
    --bg: #ffffff;
    --card: #ffffff;
    --card-alt: #f4f4f5;
    --card-dark: #f0f0f0;
    --border: #e4e4e7;
    --border-light: #f0f0f0;
    --text: #18181b;
    --text-muted: #52525b;
    --text-dim: #71717a;
    --text-dimmer: #a1a1aa;
    --muted: #71717a;
    --nav-bg: #ffffff;
    --badge-bg: rgba(25, 227, 50, 0.07);
    --badge-border: rgba(25, 227, 50, 0.18);
    --glow-light: rgba(25, 227, 50, 0.08);
}

/* ── Auth & Form pages: .signin-* (signin.html, register.html, landing.html) ── */
body.light-mode .signin-nav {
    background: #ffffff;
    border-bottom-color: #e4e4e7;
}
body.light-mode .signin-nav-home { color: #71717a; }
body.light-mode .signin-nav-home:hover { color: #18181b; }

body.light-mode .signin-card {
    background: #ffffff;
    border-color: #e4e4e7;
}
body.light-mode .signin-title { color: #18181b; }
body.light-mode .signin-subtitle,
body.light-mode .signin-card-desc { color: #52525b; }

body.light-mode .form-label { color: #52525b; }
body.light-mode .form-input,
body.light-mode .form-select,
body.light-mode .form-textarea {
    background: #ffffff;
    border-color: #e4e4e7;
    color: #18181b;
}
body.light-mode .form-input::placeholder,
body.light-mode .form-textarea::placeholder { color: #a1a1aa; }
body.light-mode .form-select option { background: #ffffff; color: #18181b; }

body.light-mode .signin-btn-secondary {
    border-color: #e4e4e7;
    color: #52525b;
}
body.light-mode .signin-btn-secondary:hover {
    border-color: #d4d4d8;
    color: #18181b;
}
body.light-mode .signin-divider-line { background: #e4e4e7; }
body.light-mode .signin-divider-text { color: #a1a1aa; }
body.light-mode .signin-info {
    background: #f4f4f5;
    border-color: #e4e4e7;
}
body.light-mode .signin-info-text { color: #52525b; }
body.light-mode .signin-footer { color: #71717a; }
body.light-mode .signin-footer a { color: #19E332; }

/* ── Landing page specific ── */
body.light-mode .landing-subtitle { color: #52525b; }
body.light-mode .footer-note { color: #71717a; }
body.light-mode .flow-connector-line { background: #e4e4e7; }
body.light-mode .flow-step-desc { color: #71717a; }
body.light-mode .feature-label { color: #52525b; }

/* ── Talent Signup: .signup-* and .ob-* (talent_signup.html) ── */
body.light-mode .signup-nav {
    background: #ffffff;
    border-bottom-color: #e4e4e7;
}
body.light-mode .signup-nav-link { color: #71717a; }
body.light-mode .signup-nav-link:hover { color: #18181b; }
body.light-mode .signup-nav-badge {
    background: rgba(25, 227, 50, 0.07);
    border-color: rgba(25, 227, 50, 0.18);
}
body.light-mode .signup-title { color: #18181b; }
body.light-mode .signup-subtitle { color: #52525b; }

body.light-mode .ob-nav {
    background: #ffffff;
    border-bottom-color: #e4e4e7;
}
body.light-mode .ob-option-card {
    background: #ffffff;
    border-color: #e4e4e7;
    color: #18181b;
}
body.light-mode .ob-option-card:hover {
    border-color: rgba(25, 227, 50, 0.4);
    background: rgba(25, 227, 50, 0.03);
}
body.light-mode .ob-option-card.selected {
    border-color: #19E332;
    background: rgba(25, 227, 50, 0.04);
}
body.light-mode .ob-option-label { color: #18181b; }
body.light-mode .ob-option-sub { color: #71717a; }
body.light-mode .ob-exp-card {
    background: #ffffff;
    border-color: #e4e4e7;
}
body.light-mode .ob-exp-card.selected {
    background: rgba(25, 227, 50, 0.04);
    border-color: #19E332;
}
body.light-mode .ob-exp-label { color: #18181b; }
body.light-mode .ob-exp-sub { color: #71717a; }
body.light-mode .ob-chip {
    background: #f4f4f5;
    border-color: #e4e4e7;
    color: #52525b;
}
body.light-mode .ob-chip.selected {
    background: rgba(25, 227, 50, 0.08);
    border-color: rgba(25, 227, 50, 0.3);
    color: #18181b;
}
body.light-mode .ob-equipment-tags { background: #f9f9f9; border-color: #e4e4e7; }
body.light-mode .ob-equipment-tag {
    background: #f4f4f5;
    border-color: #e4e4e7;
    color: #52525b;
}
body.light-mode .ob-add-btn {
    background: #f4f4f5;
    border-color: #e4e4e7;
    color: #52525b;
}
body.light-mode .ob-add-btn:hover { background: #e4e4e7; }
body.light-mode .ob-range-labels { color: #71717a; }
body.light-mode .ob-char-count { color: #a1a1aa; }
body.light-mode .ob-review-avatar { border-color: #e4e4e7; background: #f4f4f5; }
body.light-mode .ob-photo-placeholder {
    background: #f4f4f5;
    border-color: #e4e4e7;
    color: #71717a;
}
body.light-mode .ob-photo-hint { color: #a1a1aa; }
body.light-mode .signin-prompt { color: #71717a; }
body.light-mode .error-msg { color: #ef4444; }

/* ── Admin pages: .admin-* (admin.html, admin_now_shop.html) ── */
body.light-mode .admin-nav {
    background: #ffffff;
    border-bottom-color: #e4e4e7;
}
body.light-mode .admin-nav-right a { color: #71717a; }
body.light-mode .admin-nav-right a:hover { color: #18181b; }
body.light-mode .admin-tabs {
    background: #ffffff;
    border-bottom: 1px solid #e4e4e7;
}
body.light-mode .admin-tab { color: #71717a; }
body.light-mode .admin-tab:hover { color: #19E332; }
body.light-mode .admin-tab.active { color: #19E332; }
body.light-mode .admin-content { background: #f9f9f9; }
body.light-mode .admin-header {
    background: #ffffff;
    border-bottom-color: #e4e4e7;
}
body.light-mode .admin-body { background: #f9f9f9; }

body.light-mode .stat-card {
    background: #ffffff;
    border-color: #e4e4e7;
}
body.light-mode .stat-label { color: #71717a; }

body.light-mode .data-table-wrap,
body.light-mode .table-wrap {
    background: #ffffff;
    border-color: #e4e4e7;
}
body.light-mode .data-table th,
body.light-mode .table-header {
    background: #f4f4f5;
    color: #71717a;
    border-bottom-color: #e4e4e7;
}
body.light-mode .data-table td { border-bottom-color: #f0f0f0; }
body.light-mode .data-table tr:hover td { background: rgba(0,0,0,0.02); }
body.light-mode .section-label { color: #71717a; }

body.light-mode .search-input,
body.light-mode .filter-select {
    background: #ffffff;
    border-color: #e4e4e7;
    color: #18181b;
}
body.light-mode .search-input::placeholder { color: #a1a1aa; }
body.light-mode .filter-select option { background: #ffffff; color: #18181b; }

body.light-mode .controls-bar { border-bottom-color: #e4e4e7; }
body.light-mode .empty-state { color: #71717a; }

body.light-mode .modal-overlay { background: rgba(0, 0, 0, 0.45); }
body.light-mode .modal,
body.light-mode .modal-box {
    background: #ffffff;
    border-color: #e4e4e7;
}
body.light-mode .modal-header,
body.light-mode .modal-body {
    background: #ffffff;
    border-color: #e4e4e7;
    color: #18181b;
}
body.light-mode .modal-footer { border-top-color: #e4e4e7; background: #ffffff; }
body.light-mode .modal-close { color: #71717a; }
body.light-mode .modal-close:hover { color: #18181b; background: #f4f4f5; }

body.light-mode .tag,
body.light-mode .cat-badge {
    background: #f4f4f5;
    border-color: #e4e4e7;
    color: #52525b;
}
body.light-mode .preset-name { color: #18181b; }
body.light-mode .preset-sub { color: #71717a; }
body.light-mode .list-input-row { border-color: #e4e4e7; }
body.light-mode .list-input-group input {
    background: #ffffff;
    border-color: #e4e4e7;
    color: #18181b;
}
body.light-mode .form-check { color: #52525b; }
body.light-mode .form-hint { color: #a1a1aa; }

/* ── Talent Portfolio: uses CSS vars (handled by body.light-mode vars above) ── */
body.light-mode .talent-nav {
    background: #ffffff;
    border-bottom-color: #e4e4e7;
}
body.light-mode .talent-nav-link { color: #71717a; }
body.light-mode .talent-nav-link:hover { color: #18181b; background: #f4f4f5; }
body.light-mode .talent-nav-link.active {
    color: #19E332;
    background: rgba(25, 227, 50, 0.06);
}
body.light-mode .btn-secondary {
    background: #f4f4f5;
    border-color: #e4e4e7;
    color: #52525b;
}
body.light-mode .btn-secondary:hover {
    background: #e4e4e7;
    color: #18181b;
}

/* ── Chat Public page: .hero-section, h1 gradient ── */
body.light-mode .hero-section { background: #f9f9f9; }
body.light-mode .content-side h1 {
    background: linear-gradient(135deg, #18181b 30%, #52525b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
body.light-mode .content-side .subtitle { color: #52525b; }
body.light-mode .features-row { border-top-color: #e4e4e7; }

/* ── Generic shared dark elements across all pages ── */
body.light-mode input:not([type="range"]),
body.light-mode textarea,
body.light-mode select {
    background-color: #ffffff;
    border-color: #e4e4e7;
    color: #18181b;
}
body.light-mode input::placeholder,
body.light-mode textarea::placeholder { color: #a1a1aa; }

@media (max-width: 600px) {
    .opah-toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
    }
    .opah-toast {
        min-width: unset;
        max-width: unset;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .scroll-reveal, .scroll-reveal-scale {
        opacity: 1 !important;
        transform: none !important;
    }
}
