.nav-menu-item.bg-orange-500,
.nav-menu-item.bg-orange-500 span,
.nav-menu-item.bg-orange-500 i { color: white !important; }
.nav-menu-item.bg-orange-500:hover,
.nav-menu-item.bg-orange-500:hover span,
.nav-menu-item.bg-orange-500:hover i { color: white !important; }
.dark .nav-menu-item.bg-orange-500,
.dark .nav-menu-item.bg-orange-500 span,
.dark .nav-menu-item.bg-orange-500 i,
.dark .nav-menu-item.bg-orange-500:hover,
.dark .nav-menu-item.bg-orange-500:hover span,
.dark .nav-menu-item.bg-orange-500:hover i { color: #1c1917 !important; }
body { font-family: 'Inter', sans-serif; transition: background-color 0.3s ease; }

/* === Glassmorphism surfaces === */
.category-section {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    position: relative;
    isolation: isolate;
}
.dark .category-section {
    background: rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

/* Link cards with glassmorphism */
.link-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.03);
    position: relative;
    isolation: isolate;
    transition: all 0.3s ease;
}
.dark .link-card {
    background: rgba(0,0,0,0.15);
    border-color: rgba(255,255,255,0.06);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.link-card:hover {
    transform: translateY(-6px);
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
}
.dark .link-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

/* Contrast scrim for readability inside glass panels */
.category-section::before,
.link-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%);
    pointer-events: none;
    z-index: -1;
}
.dark .category-section::before,
.dark .link-card::before {
    background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 100%);
}

/* Text readability on glass */
.link-card .link-name {
    text-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.dark .link-card .link-name {
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Reduced motion / reduced transparency fallbacks */
@media (prefers-reduced-motion: reduce) {
    .link-card { transition: none; }
    .link-card:hover { transform: none; }
    .announcement-bar .ann-inner.amber,
    .announcement-bar .ann-inner.rose,
    .announcement-bar .ann-inner.emerald,
    .announcement-bar .ann-inner.sky {
        animation: none;
    }
}
@media (prefers-reduced-transparency: reduce) {
    .category-section {
        background: rgba(255,255,255,0.85);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .link-card {
        background: rgba(255,255,255,0.85);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .announcement-bar .ann-inner {
        background: rgba(255,255,255,0.85);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .dark .category-section {
        background: rgba(28,25,23,0.85);
    }
    .dark .link-card {
        background: rgba(28,25,23,0.85);
    }
    .dark .announcement-bar .ann-inner {
        background: rgba(28,25,23,0.85);
    }
}

/* === Theme: Orange (403 style) === */
html.theme-orange body {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 30%, #FFB347 60%, #FFA500 100%) !important;
    position: relative;
}
html.theme-orange .announcement-bar .ann-inner {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
html.theme-orange .dark .announcement-bar .ann-inner {
    background: rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.08);
}

html.theme-orange .bg-effects {
    display: block;
}

/* Theme toggle icons */
html.theme-orange .theme-only-orange { display: inline-block !important; }
html.theme-orange .theme-only-light,
html.theme-orange .theme-only-dark { display: none !important; }

/* Background effects layer (hidden by default) */
.bg-effects {
    display: none;
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-effects .gradient-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 25%, rgba(251,146,60,0.25) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 75%, rgba(59,130,246,0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 55% 50%, rgba(236,72,153,0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 70% 20%, rgba(255,107,53,0.15) 0%, transparent 40%);
}
.dark .bg-effects .gradient-bg {
    background:
        radial-gradient(ellipse at 15% 25%, rgba(251,146,60,0.15) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 75%, rgba(59,130,246,0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 55% 50%, rgba(236,72,153,0.08) 0%, transparent 45%);
    animation: bgPulse 8s ease-in-out infinite alternate;
}
@keyframes bgPulse {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.08); }
}

.bg-effects .grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 20s linear infinite;
}
@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

.bg-effects .corner-glow {
    position: absolute;
    width: 200px; height: 200px;
    border-radius: 50%;
    pointer-events: none;
}
.bg-effects .corner-glow.tl {
    top: -100px; left: -100px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: cornerPulse1 6s ease-in-out infinite;
}
.bg-effects .corner-glow.br {
    bottom: -100px; right: -100px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    animation: cornerPulse2 6s ease-in-out infinite reverse;
}
@keyframes cornerPulse1 {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.5); opacity: 0.6; }
}
@keyframes cornerPulse2 {
    0%, 100% { transform: scale(1.2); opacity: 0.4; }
    50% { transform: scale(0.8); opacity: 0.2; }
}

.bg-effects .particle {
    position: absolute;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}
.bg-effects .particle:nth-child(4) { width: 6px; height: 6px; left: 10%; animation-duration: 10s; animation-delay: 0s; }
.bg-effects .particle:nth-child(5) { width: 4px; height: 4px; left: 25%; animation-duration: 14s; animation-delay: 2s; }
.bg-effects .particle:nth-child(6) { width: 8px; height: 8px; left: 40%; animation-duration: 12s; animation-delay: 1s; }
.bg-effects .particle:nth-child(7) { width: 3px; height: 3px; left: 55%; animation-duration: 16s; animation-delay: 3s; }
.bg-effects .particle:nth-child(8) { width: 5px; height: 5px; left: 70%; animation-duration: 11s; animation-delay: 0.5s; }
.bg-effects .particle:nth-child(9) { width: 7px; height: 7px; left: 85%; animation-duration: 13s; animation-delay: 2.5s; }
@keyframes particleFloat {
    0% { transform: translateY(100vh) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-50px) translateX(40px); opacity: 0; }
}

html.theme-orange .category-section {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
}
html.theme-orange .dark .category-section {
    background: rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

html.theme-orange .link-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.03);
}
html.theme-orange .dark .link-card {
    background: rgba(0,0,0,0.15);
    border-color: rgba(255,255,255,0.06);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
html.theme-orange .link-card:hover {
    transform: translateY(-6px);
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
}
html.theme-orange .dark .link-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.space-y-16 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-y-reverse: 0;
    margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse))) !important;
    margin-bottom: calc(4rem * var(--tw-space-y-reverse));
}

/* Link card hover transition */
.link-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}




.pt-4 { padding-top: 1rem; padding-bottom: 1rem; }
.p-2 { padding: 0rem !important; }
.p-2\.5 { padding: 0rem !important; }
.p-5 { padding: 0.8rem !important; }
@media (max-width: 767px) {
    .py-3\.5 { padding-top: 2px !important; padding-bottom: 2px !important; }
}
.mt-1\.5 { margin-top: 0.375rem; margin-bottom: 0.375rem; }
.pr-6 { padding-right: 2px !important; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.thin-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.thin-scrollbar::-webkit-scrollbar-thumb { background: rgba(148,163,184,.45); border-radius: 999px; }
.route-dots {
    background-image: radial-gradient(circle, rgba(255,255,255,0.12) 1px, transparent 1.4px);
    background-size: 18px 18px;
}
mark { background: rgba(234,88,12,0.28); color: inherit; border-radius: 3px; padding: 0 1px; }
.dark mark { background: rgba(251,146,60,0.35); }
.edit-mode input { transition: all 0.15s ease; }
.link-icon { width: 32px; height: 32px; flex-shrink: 0; }
i.link-icon { font-size: 24px !important; line-height: 1; display: inline-flex; align-items: center; justify-content: center; border-radius: 9999px; }
img.link-icon { object-fit: contain; border-radius: 9999px; }
.cat-icon { font-size: 18px !important; padding: 6px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.star-btn i { display: inline-flex; align-items: center; justify-content: center; }
#pinModal input[type="password"] { font-family: 'Courier New', monospace; letter-spacing: 0.5em; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* === Custom Notification Dialog === */
.custom-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.custom-dialog-overlay.hidden {
    display: none;
}
.custom-dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(28,25,23,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.custom-dialog-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    border: 1px solid #e7e5e4;
    max-width: 28rem;
    width: 100%;
    padding: 1.5rem;
    animation: fadeInUp 0.2s ease-out forwards;
}
.dark .custom-dialog-box {
    background: #1c1917;
    border-color: #292524;
}
.custom-dialog-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff7ed;
}
.dark .custom-dialog-icon {
    background: rgba(251,146,60,0.1);
}
.custom-dialog-icon i {
    font-size: 1.25rem;
    color: #f97316;
}
.custom-dialog-message {
    text-align: center;
    font-size: 0.875rem;
    color: #57534e;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}
.dark .custom-dialog-message {
    color: #a8a29e;
}
.custom-dialog-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background: #fafaf9;
    border: 1px solid #e7e5e4;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    margin-bottom: 0.75rem;
}
.dark .custom-dialog-input {
    background: #292524;
    border-color: #44403c;
    color: #e7e5e4;
}
.custom-dialog-input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}
.custom-dialog-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}
.custom-dialog-btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s;
}
.custom-dialog-btn-primary {
    background: #f97316;
    color: #fff;
}
.custom-dialog-btn-primary:hover {
    background: #ea580c;
}
.custom-dialog-btn-secondary {
    background: #f5f5f4;
    color: #57534e;
}
.dark .custom-dialog-btn-secondary {
    background: #292524;
    color: #a8a29e;
}
.custom-dialog-btn-secondary:hover {
    background: #e7e5e4;
}
.dark .custom-dialog-btn-secondary:hover {
    background: #44403c;
}

/* Custom Toast for alert() */
.custom-alert-toast {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 300;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    max-width: 24rem;
    pointer-events: auto;
}
.custom-alert-toast.info {
    background: #f97316;
    color: #fff;
}
.custom-alert-toast.success {
    background: #059669;
    color: #fff;
}
.custom-alert-toast.error {
    background: #e11d48;
    color: #fff;
}
.custom-alert-toast.hidden {
    display: none;
}

@keyframes fadeSlide {
    0% { opacity: 0; transform: translateY(-8px); }
    100% { opacity: 1; transform: translateY(0); }
}
.announcement-bar { animation: fadeSlide 0.4s ease-out both; }
.announcement-bar:nth-child(2) { animation-delay: 0.05s; }
.announcement-bar:nth-child(3) { animation-delay: 0.1s; }
.announcement-bar:nth-child(4) { animation-delay: 0.15s; }
.announcement-bar:nth-child(5) { animation-delay: 0.2s; }
.announcement-bar .indent-5::before { content: "- "; margin-right: 0.25em; }
.announcement-bar .ann-inner {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 16px;
    position: relative;
    isolation: isolate;
}
.dark .announcement-bar .ann-inner {
    background: rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.08);
}
.announcement-bar .ann-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%);
    pointer-events: none;
    z-index: -1;
}
.dark .announcement-bar .ann-inner::before {
    background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 100%);
}
@keyframes starRun {
    0% { box-shadow: 0 -3px 8px -1px var(--star-color), 0 8px 32px rgba(0,0,0,0.08); }
    12.5% { box-shadow: 2px -2px 8px -1px var(--star-color), 0 8px 32px rgba(0,0,0,0.08); }
    25% { box-shadow: 3px 0 8px -1px var(--star-color), 0 8px 32px rgba(0,0,0,0.08); }
    37.5% { box-shadow: 2px 2px 8px -1px var(--star-color), 0 8px 32px rgba(0,0,0,0.08); }
    50% { box-shadow: 0 3px 8px -1px var(--star-color), 0 8px 32px rgba(0,0,0,0.08); }
    62.5% { box-shadow: -2px 2px 8px -1px var(--star-color), 0 8px 32px rgba(0,0,0,0.08); }
    75% { box-shadow: -3px 0 8px -1px var(--star-color), 0 8px 32px rgba(0,0,0,0.08); }
    87.5% { box-shadow: -2px -2px 8px -1px var(--star-color), 0 8px 32px rgba(0,0,0,0.08); }
    100% { box-shadow: 0 -3px 8px -1px var(--star-color), 0 8px 32px rgba(0,0,0,0.08); }
}
.announcement-bar .ann-inner.amber { --star-color: rgba(251,191,36,0.7); animation: starRun 6s linear infinite; }
.announcement-bar .ann-inner.rose { --star-color: rgba(225,29,72,0.7); animation: starRun 6s linear infinite; }
.announcement-bar .ann-inner.emerald { --star-color: rgba(5,150,105,0.7); animation: starRun 6s linear infinite; }
.announcement-bar .ann-inner.sky { --star-color: rgba(14,165,233,0.7); animation: starRun 6s linear infinite; }




