/* TexBid Design System — Global Styles */

/* Smooth scrolling & font rendering */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background-color: #1b4478;
    color: white;
}

/* ===== NAVBAR FIXES ===== */
.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar-logo {
    flex-shrink: 0;
}

.navbar-menu {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.navbar-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Notification bell styling */
.notification-bell {
    position: relative;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.notification-bell:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Ensure proper spacing on mobile */
@media (max-width: 1024px) {
    .navbar-menu {
        display: none;
    }
    
    .navbar-actions {
        gap: 0.5rem;
    }
}

/* ===== MOBILE MENU ===== */
#mobile-menu-panel {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 9999;
    background-color: #0f172a; /* brand-dark solid — no transparency */
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: max-height;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Inner container padding */
#mobile-menu-panel > div {
    padding: 0.5rem 1rem 1rem;
    background-color: #0f172a;
}

/* Staggered fade-in for mobile nav links */
#mobile-menu-panel:not(.hidden) .mobile-nav-link {
    animation: mobileNavFadeIn 0.3s ease forwards;
    opacity: 0;
    transform: translateX(-12px);
}

#mobile-menu-panel:not(.hidden) .mobile-nav-link:nth-child(1)  { animation-delay: 0.04s; }
#mobile-menu-panel:not(.hidden) .mobile-nav-link:nth-child(2)  { animation-delay: 0.08s; }
#mobile-menu-panel:not(.hidden) .mobile-nav-link:nth-child(3)  { animation-delay: 0.12s; }
#mobile-menu-panel:not(.hidden) .mobile-nav-link:nth-child(4)  { animation-delay: 0.16s; }
#mobile-menu-panel:not(.hidden) .mobile-nav-link:nth-child(5)  { animation-delay: 0.20s; }
#mobile-menu-panel:not(.hidden) .mobile-nav-link:nth-child(6)  { animation-delay: 0.24s; }
#mobile-menu-panel:not(.hidden) .mobile-nav-link:nth-child(7)  { animation-delay: 0.28s; }
#mobile-menu-panel:not(.hidden) .mobile-nav-link:nth-child(8)  { animation-delay: 0.32s; }
#mobile-menu-panel:not(.hidden) .mobile-nav-link:nth-child(9)  { animation-delay: 0.36s; }
#mobile-menu-panel:not(.hidden) .mobile-nav-link:nth-child(10) { animation-delay: 0.40s; }

@keyframes mobileNavFadeIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile section headers */
.mobile-nav-section > p {
    letter-spacing: 0.08em;
}

/* Hamburger / Close icon transition */
#hamburger-icon,
#close-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active link highlight on mobile */
@media (max-width: 1023px) {
    .mobile-nav-link:active {
        background-color: rgba(255, 255, 255, 0.15) !important;
        transform: scale(0.98);
    }
    
    /* Limit mobile menu panel height so it scrolls if there are many links */
    #mobile-menu-panel > div {
        max-height: calc(100vh - 5rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== ANIMATIONS ===== */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
.animate-slide-in-right {
    animation: slideInRight 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}
.animate-slide-in-left {
    animation: slideInLeft 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pulse-slow {
    0%, 100% { opacity: 0.3; transform: scale(1) translate(0, 0); }
    50%      { opacity: 0.6; transform: scale(1.05) translate(20px, -20px); }
}
.animate-pulse-slow {
    animation: pulse-slow 10s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.animate-shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes pulseRing {
    0%   { box-shadow: 0 0 0 0 rgba(27,68,120,0.4); }
    70%  { box-shadow: 0 0 0 6px rgba(27,68,120,0); }
    100% { box-shadow: 0 0 0 0 rgba(27,68,120,0); }
}

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-500 { animation-delay: 500ms; }
.delay-700 { animation-delay: 700ms; }
.delay-1000 { animation-delay: 1000ms; }

/* ===== GLASSMORPHISM ===== */
.glassmorphism {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255,255,255,0.5);
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.25s ease;
    flex-shrink: 0;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 9999px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.25s ease;
}
.toggle-switch.active {
    background: #1b4478;
}
.toggle-switch.active::after {
    transform: translateX(20px);
}

/* ===== CUSTOM SCROLLBAR ===== */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== HIDE SCROLLBAR UTILITY ===== */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== INLINE VALIDATION ===== */
.field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239,68,68,0.15);
}
.field-error-msg {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 4px;
    animation: fadeInUp 0.3s ease forwards;
}

/* ===== STEP CONTENT TRANSITION ===== */
.step-panel {
    display: none;
}
.step-panel.active {
    display: block;
}

/* ===== DRAG-DROP ZONE ===== */
.drop-zone.drag-over {
    border-color: #1b4478;
    background-color: rgba(27,68,120,0.04);
}

/* ===== UPLOAD PROGRESS BAR ===== */
@keyframes uploadProgress {
    0%   { width: 0%; }
    30%  { width: 45%; }
    60%  { width: 75%; }
    100% { width: 100%; }
}
.upload-progress-bar {
    height: 4px;
    background: #1b4478;
    border-radius: 999px;
    animation: uploadProgress 1.8s ease-out forwards;
}

/* ===== SUCCESS CHECKMARK ===== */
@keyframes checkmarkStroke {
    0%   { stroke-dashoffset: 48; }
    100% { stroke-dashoffset: 0; }
}
@keyframes checkmarkCircle {
    0%   { stroke-dashoffset: 166; }
    100% { stroke-dashoffset: 0; }
}
@keyframes checkmarkScale {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.1); }
}
.checkmark-svg { animation: checkmarkScale 0.4s ease-in-out 0.7s; }
.checkmark-svg .circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: checkmarkCircle 0.6s ease-in-out forwards;
}
.checkmark-svg .check {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: checkmarkStroke 0.3s ease-in-out 0.5s forwards;
}

/* ===== TRUST SCORE GAUGE ===== */
@keyframes gaugeStroke {
    from { stroke-dashoffset: var(--gauge-offset, 283); }
    to   { stroke-dashoffset: var(--gauge-target, 0); }
}
.trust-gauge-circle {
    animation: gaugeStroke 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform-origin: center;
    transform: rotate(-90deg);
}

/* ===== CERTIFICATION CARD ===== */
.cert-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cert-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

/* ===== LOCKED STATE OVERLAY ===== */
.locked-overlay {
    position: relative;
    pointer-events: none;
    user-select: none;
}
.locked-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(248, 250, 252, 0.7);
    backdrop-filter: blur(2px);
    border-radius: inherit;
    z-index: 5;
}

/* ===== STAT CARD ===== */
.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

/* ===== INLINE VALIDATION ERRORS ===== */
.field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}
.field-error-msg {
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.375rem;
}

/* ===== REDUCED MOTION =====
   Honour the OS-level "reduce motion" setting. Entrance animations resolve to
   their finished state instead of being skipped, so nothing stays invisible. */
@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;
    }
    .animate-fade-in-up {
        opacity: 1;
        transform: none;
    }
}
