/* ==========================================================
   Light Mode Theme Overrides - SocialPulse
   File: public/css/light-theme.css
   ========================================================== */

/* 1. Global Page Backgrounds and Grids */
body.login-body,
body.register-body {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    color: #0f172a !important;
}

.grid-bg {
    background-image: linear-gradient(rgba(0, 0, 0, .02) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, .02) 1px, transparent 1px) !important;
    background-size: 60px 60px !important;
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.grid-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(124, 58, 237, .02), transparent 70%);
}

.orb {
    filter: blur(100px) !important;
    opacity: 0.4 !important;
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.orb1 { background: #c084fc !important; }
.orb2 { background: #818cf8 !important; }
.orb3 { background: #fda4af !important; }

/* 2. Authentication Container Cards */
.register-card-container {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02) !important;
}

/* 3. Showcase Side Panels */
.showcase-panel {
    background: linear-gradient(135deg, #f5f3ff 0%, #e0e7ff 100%) !important;
    border-right: 1px solid #e2e8f0 !important;
}
.showcase-dark-overlay {
    background: transparent !important;
}
.showcase-grid-pattern {
    opacity: 0.05 !important;
}
.showcase-title {
    color: #1e1b4b !important;
}
.plans-section-title {
    background: linear-gradient(135deg, #0f172a 0%, #4f46e5 50%, #7c3aed 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
}
.showcase-title span {
    background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}
.showcase-desc {
    color: #475569 !important;
}
.brand-icon-box {
    background: linear-gradient(135deg, #7c3aed, #db2777) !important;
    border: 1px solid rgba(124, 58, 237, 0.2) !important;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2) !important;
}
.brand-icon-svg {
    stroke: #ffffff !important;
}
.brand-name {
    color: #1e1b4b !important;
}
.brand-subtext {
    color: var(--platform-color) !important;
}

/* 4. Form Columns & Controls */
.form-headline {
    color: #0f172a !important;
}
.form-subheadline {
    color: #475569 !important;
}
.section-label {
    color: #475569 !important;
}
.form-input-control {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
.form-input-control:focus {
    border-color: var(--platform-color) !important;
    box-shadow: 0 0 0 4px rgba(var(--platform-color-rgb), 0.1) !important;
}
.input-icon-group svg {
    color: #64748b !important;
}
.terms-label {
    color: #475569 !important;
}
.back-link {
    color: #64748b !important;
}
.back-link:hover {
    color: var(--platform-color) !important;
}
.login-redirect-info span {
    color: #64748b !important;
}
.submit-growth-btn {
    background: var(--platform-gradient) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px var(--platform-glow) !important;
}
.submit-growth-btn:hover {
    opacity: 0.95 !important;
}
.form-footer-section span {
    color: #94a3b8 !important;
}
.divider-text {
    background: #ffffff !important;
    color: #64748b !important;
}
.divider-line {
    background-color: #e2e8f0 !important;
}
.oauth-provider-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
.oauth-provider-btn:hover {
    background: #f8fafc !important;
}

/* 5. User Registration Multi-step Details */
.role-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
.role-card:hover {
    border-color: var(--platform-color) !important;
}
.role-card.selected {
    background: rgba(var(--platform-color-rgb), 0.05) !important;
    border-color: var(--platform-color) !important;
}
.role-title {
    color: #0f172a !important;
}
.role-desc {
    color: #475569 !important;
}
.step-dot {
    background: #cbd5e1 !important;
}
.step-dot.active {
    background: var(--platform-color) !important;
}
.step-dot.completed {
    background: #10b981 !important;
}
.nav-prev-btn {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}
.nav-prev-btn:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}
.file-upload-zone {
    background: #f8fafc !important;
    border: 2px dashed #cbd5e1 !important;
    color: #475569 !important;
}
.file-upload-zone:hover {
    border-color: var(--platform-color) !important;
}
.upload-desc {
    color: #64748b !important;
}
.social-input-row span {
    color: #475569 !important;
}

/* 6. Pulse Rate Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.pulse-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

/* Energetic Glowing Boost Core */
.pulse-heart {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 0 25px rgba(124, 58, 237, 0.45), 
                0 0 50px rgba(219, 39, 119, 0.25),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
    z-index: 2;
    position: relative;
    animation: corePulse 0.8s ease-in-out infinite alternate;
}

.pulse-heart svg {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
    animation: logoWobble 1.6s ease-in-out infinite alternate;
}

/* Pulse Core Ripple Ring */
.pulse-wave {
    position: absolute;
    top: 40px; /* Centered relative to 80px core height */
    left: 50%;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px solid rgba(124, 58, 237, 0.25);
    z-index: 1;
    transform: translate(-50%, -50%);
    animation: ripplePulse 1.6s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

/* Floating Boost Pills */
.boost-bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(124, 58, 237, 0.2);
    padding: 4px 10px;
    border-radius: 9999px;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.12), 
                0 0 8px rgba(124, 58, 237, 0.05);
    pointer-events: none;
    z-index: 3;
    animation: floatBubble 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Pill Bubble Color Varieties */
.bubble-pink { color: #db2777 !important; border-color: rgba(219, 39, 119, 0.3) !important; background: rgba(255, 241, 248, 0.95) !important; }
.bubble-green { color: #059669 !important; border-color: rgba(5, 150, 105, 0.3) !important; background: rgba(240, 253, 244, 0.95) !important; }
.bubble-blue { color: #2563eb !important; border-color: rgba(37, 99, 235, 0.3) !important; background: rgba(239, 246, 255, 0.95) !important; }
.bubble-purple { color: #7c3aed !important; border-color: rgba(124, 58, 237, 0.3) !important; background: rgba(245, 243, 255, 0.95) !important; }
.bubble-orange { color: #ea580c !important; border-color: rgba(234, 88, 12, 0.3) !important; background: rgba(255, 247, 237, 0.95) !important; }
.bubble-yellow { color: #d97706 !important; border-color: rgba(217, 119, 6, 0.3) !important; background: rgba(254, 252, 232, 0.95) !important; }
.bubble-cyan { color: #0891b2 !important; border-color: rgba(8, 145, 178, 0.3) !important; background: rgba(236, 254, 255, 0.95) !important; }

.pulse-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #475569;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}



/* Animations */
@keyframes corePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 20px rgba(124, 58, 237, 0.35); }
    100% { transform: scale(1.08); box-shadow: 0 0 35px rgba(124, 58, 237, 0.6), 0 0 60px rgba(219, 39, 119, 0.35); }
}

@keyframes logoWobble {
    0% { transform: rotate(-3deg) scale(0.95); }
    100% { transform: rotate(3deg) scale(1.05); }
}

@keyframes ripplePulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

@keyframes floatBubble {
    0% {
        transform: translate(-50%, -50%) scale(0.6);
        opacity: 0;
        top: 40px; /* Center of desktop badge */
        left: 50%;
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--drift-x), -120px) scale(0.85);
        top: 40px;
        left: 50%;
    }
}

/* Mobile responsive scaling */
@media (max-width: 640px) {
    .pulse-heart {
        width: 60px !important;
        height: 60px !important;
    }
    .pulse-heart svg {
        width: 1.6rem !important;
        height: 1.6rem !important;
    }
    .pulse-wave {
        top: 30px !important; /* Half of 60px height */
        width: 70px !important;
        height: 70px !important;
    }
    .pulse-text {
        font-size: 0.8rem !important;
        letter-spacing: 0.2em !important;
    }

    @keyframes floatBubble {
        0% {
            transform: translate(-50%, -50%) scale(0.6);
            opacity: 0;
            top: 30px; /* Center of mobile badge */
            left: 50%;
        }
        15% {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1.1);
        }
        100% {
            opacity: 0;
            transform: translate(var(--drift-x), -90px) scale(0.8);
            top: 30px;
            left: 50%;
        }
    }
}

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

.showcase-feature-circle {
    background: rgba(124, 58, 237, 0.1) !important;
    border: 1px solid rgba(124, 58, 237, 0.18) !important;
}
.showcase-feature-check {
    color: #7c3aed !important;
}
.showcase-feature-text {
    color: #475569 !important;
}

/* Light Theme Checkbox High Contrast Overrides */
.custom-checkbox {
    border: 1.5px solid #cbd5e1 !important;
    background-color: #ffffff !important;
}
.custom-checkbox:hover {
    border-color: #94a3b8 !important;
}
.custom-checkbox:checked {
    background-color: #7c3aed !important;
    border-color: #7c3aed !important;
}
.custom-checkbox:checked::after {
    content: '' !important;
    position: absolute !important;
    left: 0.35rem !important;
    top: 0.15rem !important;
    width: 0.25rem !important;
    height: 0.5rem !important;
    border: solid #ffffff !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
}
/* Global Layout Constraints to prevent Flexbox Overflow */
body {
    overflow-x: hidden !important;
}
#adminSidebar + main {
    min-width: 0 !important;
    overflow-x: hidden !important;
}

/* Sidebar Collapse CSS */
body.sidebar-collapsed #adminSidebar { width: 5rem !important; }
body.sidebar-collapsed #adminSidebar .brand-text,
body.sidebar-collapsed #adminSidebar .user-text-info,
body.sidebar-collapsed #adminSidebar nav span { opacity: 0; width: 0; overflow: hidden; display: none; }
body.sidebar-collapsed #adminSidebar form span { display: none; }
body.sidebar-collapsed #adminSidebar .p-6 { padding-left: 1rem; padding-right: 1rem; justify-content: center; }
body.sidebar-collapsed #adminSidebar nav a { justify-content: center; padding-left: 0.75rem; padding-right: 0.75rem; }
body.sidebar-collapsed #adminSidebar nav a svg { margin: 0; }
body.sidebar-collapsed #adminSidebar .w-10 { margin: 0 auto; }
body.sidebar-collapsed #adminSidebar form button { padding: 0.5rem; }
body.sidebar-collapsed #adminSidebar .flex.items-center.justify-between { justify-content: center !important; }
body.sidebar-collapsed .animate-ping.absolute,
body.sidebar-collapsed .relative.inline-flex.rounded-full { position: absolute; top: 5px; right: 5px; }

/* Responsive Mobile Sidebar Off-Canvas styling */
@media (max-width: 768px) {
    #adminSidebar {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 50;
        height: 100vh !important;
        width: 16rem !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 5px 0 25px rgba(0,0,0,0.15);
        display: flex !important;
        flex-direction: column !important;
    }

    /* Slide in when mobile-sidebar-open class is present on body */
    body.mobile-sidebar-open #adminSidebar {
        transform: translateX(0) !important;
    }

    /* Override standard desktop collapse behaviors on mobile (forces full-width layout inside sidebar) */
    body.sidebar-collapsed #adminSidebar {
        width: 16rem !important;
        transform: translateX(-100%) !important;
    }
    body.sidebar-collapsed #adminSidebar .brand-text,
    body.sidebar-collapsed #adminSidebar .user-text-info,
    body.sidebar-collapsed #adminSidebar nav span {
        opacity: 1 !important;
        width: auto !important;
        overflow: visible !important;
        display: inline !important;
    }
    body.sidebar-collapsed #adminSidebar form span {
        display: inline !important;
    }
    body.sidebar-collapsed #adminSidebar .p-6 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
        justify-content: flex-start !important;
    }
    body.sidebar-collapsed #adminSidebar nav a {
        justify-content: flex-start !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    body.sidebar-collapsed #adminSidebar nav a svg {
        margin-right: 0.75rem !important;
    }
    body.sidebar-collapsed #adminSidebar .flex.items-center.justify-between {
        justify-content: space-between !important;
    }

    /* Strict viewport and body constraints on mobile to eliminate horizontal scrolling */
    body {
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    .flex.h-screen {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Ensure main content handles full width correctly and prevents flex overflow */
    main {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    /* Decrease header and dashboard body padding on mobile to save screen real estate */
    header {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    main > div.overflow-y-auto {
        padding: 1rem !important;
    }
    
    /* Optimize glassmorphic banner for mobile screens */
    main .bg-gradient-to-br {
        padding: 1.25rem !important;
        border-radius: 1.5rem !important;
        margin-bottom: 1.25rem !important;
    }
    main .bg-gradient-to-br h2 {
        font-size: 1.35rem !important;
        line-height: 1.25 !important;
        margin-bottom: 0.5rem !important;
    }
    main .bg-gradient-to-br p {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
    }
    main .bg-gradient-to-br .bg-white\/10 {
        padding: 1rem !important;
        gap: 0.75rem !important;
        margin-top: 0.5rem !important;
    }
    main .bg-gradient-to-br .bg-white\/10 .w-14 {
        width: 3rem !important;
        height: 3rem !important;
    }
    main .bg-gradient-to-br .bg-white\/10 .w-7 {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }

    /* Compact metric cards on mobile */
    main .grid-cols-1 > div {
        padding: 1.25rem !important;
        border-radius: 1.5rem !important;
    }
    main .grid-cols-1 > div .text-3xl {
        font-size: 1.6rem !important;
    }

    /* ── Mobile sidebar layout fix: nav scrolls, logout always visible ── */
    /*
     * The sidebar is fixed at 100vh. We must NOT let the sidebar itself scroll
     * (overflow:hidden). Instead, the inner nav wrapper scrolls and the logout
     * footer is always pinned at the bottom via flex layout.
     */
    #adminSidebar {
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Show mobile-only top bar (close + logout) — always visible at the top */
    .mobile-sidebar-top-bar {
        display: flex !important;
    }

    /* Hide desktop brand logo on mobile — the mobile top bar replaces it */
    .mobile-sidebar-top-bar ~ div {
        display: none !important;
    }

    /* But keep the nav visible */
    #adminSidebar nav {
        display: block !important;
        margin-top: 0 !important;
    }

    /* Nav wrapper: takes all remaining height and scrolls internally */
    #adminSidebar > div:first-child {
        flex: 1 1 auto !important;
        min-height: 0 !important;         /* critical: allows flex child to shrink below content size */
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    /* Logout footer: never shrinks, always fully visible at the bottom */
    #adminSidebar > div:last-child {
        flex: 0 0 auto !important;        /* do not grow or shrink */
        overflow: visible !important;
    }
}

/* ── Mobile Sidebar Backdrop Overlay ── */
#mobileSidebarBackdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
    opacity: 0;
}

body.mobile-sidebar-open #mobileSidebarBackdrop {
    display: block;
    opacity: 1;
}

