:root {
    /* Custom Emerald Green Primary Colors */
    --bs-primary: #10b981;
    --bs-primary-rgb: 16, 185, 129;
    --bs-btn-primary-bg: #10b981;
    --bs-btn-primary-border-color: #10b981;
    --bs-btn-primary-hover-bg: #059669;
    --bs-btn-primary-hover-border-color: #047857;
    --bs-btn-primary-active-bg: #047857;
    --bs-btn-primary-active-border-color: #047857;
    --bs-btn-primary-color: #ffffff;
}

[data-bs-theme="dark"] {
    --bs-primary: #10b981;
    --bs-primary-rgb: 16, 185, 129;
    --bs-btn-primary-color: #ffffff;
}

/* Base styling with Plus Jakarta Sans */
body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

code, pre, .font-monospace {
    font-family: 'JetBrains Mono', monospace !important;
}

main {
    flex-shrink: 0;
    flex-grow: 1;
    position: relative;
}

/* Ambient Radial Glow Background */
body[data-bs-theme="dark"] main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    height: 450px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.03) 45%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body[data-bs-theme="light"] main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    height: 450px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 45%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Glassmorphism Card Styling */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-bs-theme="dark"] .glass-card {
    background: rgba(21, 28, 38, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.glass-card:hover {
    box-shadow: 0 25px 50px rgba(16, 185, 129, 0.12);
}

/* Modern Input Fields */
.form-control-modern {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    transition: all 0.25s ease;
}

.form-control-modern:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
    outline: none;
}

/* Gradient Text Effect */
.text-gradient-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Modern Auth Submit Button */
.btn-auth-submit {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    letter-spacing: 0.02em !important;
    border-radius: 0.85rem !important;
    padding: 0.85rem 1.5rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.45) !important;
    position: relative !important;
    overflow: hidden !important;
}

.btn-auth-submit:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 14px 30px -5px rgba(16, 185, 129, 0.6) !important;
}

.btn-auth-submit:hover i {
    transform: translateX(4px) !important;
}

.btn-auth-submit i {
    transition: transform 0.25s ease !important;
}

.btn-auth-submit:active {
    transform: translateY(0) !important;
    box-shadow: 0 5px 15px -3px rgba(16, 185, 129, 0.4) !important;
}

/* Navbar Brand & Logo Styling */
.navbar-brand,
.navbar-brand span,
.navbar-brand i {
    color: #10b981 !important;
}
.input-group-modern {
    border-radius: 0.85rem;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    transition: all 0.25s ease;
    background-color: var(--bs-body-bg);
}

.input-group-modern:focus-within {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

.input-group-modern .input-group-text,
.input-group-modern .form-control,
.input-group-modern .btn {
    border: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Navbar Tweaks */
.navbar-brand i {
    color: var(--bs-primary);
}

/* Smooth transitions */
body, .card, .navbar, .bg-body, .bg-body-tertiary {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbar for IDE */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #6c757d;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #495057;
}

/* Custom Problems Nav Link with Underline Hover Animation */
.nav-btn-custom {
    color: var(--bs-emphasis-color, var(--bs-body-color)) !important;
    position: relative;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-btn-custom::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background-color: #10b981 !important;
    transition: width 0.3s ease, left 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-btn-custom:hover,
.nav-btn-custom:focus,
.nav-btn-custom:active {
    color: #10b981 !important;
}

.nav-btn-custom:hover::after {
    width: 100%;
}

/* Mobile mode styling */
@media (max-width: 991.98px) {
    .nav-btn-custom {
        display: inline-block;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        font-size: 1.1rem;
    }
}

/* Bookmark button feedback: brief pop/scale on save, spin while the request is in flight */
@keyframes bookmarkPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    70%  { transform: scale(0.92); }
    100% { transform: scale(1); }
}

.bookmark-pop {
    animation: bookmarkPop 0.4s ease;
}

.spin-once {
    animation: spin 0.6s linear infinite;
}

/* Simple "blast" for removing a bookmark: scale up and fade out in place */
@keyframes bookmarkBlast {
    0%   { transform: scale(1); opacity: 1; }
    50%  { transform: scale(1.8); opacity: 0.6; }
    100% { transform: scale(2.4); opacity: 0; }
}

.bookmark-blast {
    animation: bookmarkBlast 0.35s ease-out forwards;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
