/* flashcrow custom styles (Tailwind + DaisyUI + Alpine) */

[x-cloak] { display: none !important; }

:root {
    --primary-dark: #1f1f1f;
    --primary-darker: #141414;
    --surface: #2a2a2a;
    --flash-color: #fe019a;
    --flash-alt: #ffdd00;
    --white: #ffffff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Poppins', system-ui, sans-serif;
    background-color: var(--primary-dark);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

section {
    scroll-margin-top: 88px;
}

/* Flash brand accent */
.flash-text {
    color: var(--flash-color);
    text-shadow: 0 0 20px rgba(254, 1, 154, 0.5);
    animation: flashGlow 2.4s ease-in-out infinite;
}

@keyframes flashGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(254, 1, 154, 0.5); }
    50% { text-shadow: 0 0 32px rgba(254, 1, 154, 0.9), 0 0 42px rgba(254, 1, 154, 0.6); }
}

/* Gradient text */
.text-gradient-flash {
    background: linear-gradient(120deg, #ffffff 0%, var(--flash-color) 60%, #ff7ac6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Section heading underline */
.section-heading {
    position: relative;
    display: inline-block;
    padding-bottom: 0.6rem;
}

.section-heading::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 56px;
    height: 3px;
    background: linear-gradient(90deg, var(--flash-color), #ff4081);
    border-radius: 999px;
    transform: translateX(-50%);
}

/* Glass panel */
.glass {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.glass-hover {
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-hover:hover {
    background: rgba(254, 1, 154, 0.08);
    border-color: rgba(254, 1, 154, 0.35);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    transform: translateY(-6px);
}

/* Flash button */
.btn-flash {
    background: linear-gradient(45deg, var(--flash-color), #ff4081);
    border: none;
    color: var(--white);
    font-weight: 600;
    padding: 0.75rem 1.6rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
    box-shadow: 0 4px 15px rgba(254, 1, 154, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-flash:hover {
    background: linear-gradient(45deg, #ff4081, var(--flash-color));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(254, 1, 154, 0.45);
    color: var(--white);
}

.btn-flash:disabled,
.btn-flash[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-ghost-light {
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    color: var(--white);
    background: transparent;
    font-weight: 600;
    padding: 0.7rem 1.6rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    cursor: pointer;
}

.btn-ghost-light:hover {
    background: var(--white);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-ghost-flash {
    border: 1.5px solid var(--flash-color);
    color: var(--flash-color);
    background: transparent;
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-ghost-flash:hover {
    background: var(--flash-color);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(254, 1, 154, 0.35);
}

/* Hero parallax logo */
.logo-parallax {
    max-width: min(420px, 85vw);
    width: 100%;
    height: auto;
    border-radius: 18px;
    transition: transform 0.1s linear;
    animation: floaty 6s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(254, 1, 154, 0.25));
}

@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-16px); }
}

/* Form controls on dark backgrounds */
.fc-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--white);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    transition: all 0.25s ease;
    font-size: 0.95rem;
}

.fc-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.fc-input:focus {
    outline: none;
    border-color: var(--flash-color);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(254, 1, 154, 0.25);
}

.fc-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
    display: block;
}

/* Service hover tilt */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(254, 1, 154, 0.12), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.service-card:hover::before {
    opacity: 1;
}

/* Navbar */
.fc-nav {
    transition: all 0.3s ease;
}

.fc-nav.scrolled {
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fc-nav-link {
    position: relative;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    padding: 0.4rem 0.2rem;
    transition: color 0.25s ease;
}

.fc-nav-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: var(--flash-color);
    transition: width 0.25s ease;
    transform: translateX(-50%);
}

.fc-nav-link:hover {
    color: var(--flash-color);
}

.fc-nav-link:hover::after {
    width: 100%;
}

/* Cookie banner animation */
.cookie-slide-in {
    transform: translateY(0);
    opacity: 1;
}

.cookie-slide-out {
    transform: translateY(120%);
    opacity: 0;
}

/* Tech chip */
.tech-chip {
    background: rgba(254, 1, 154, 0.1);
    border: 1px solid rgba(254, 1, 154, 0.3);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--white);
    transition: all 0.25s ease;
}

.tech-chip:hover {
    background: rgba(254, 1, 154, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Status chips for Our Work */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.status-chip::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.status-completed {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.08);
    border-color: rgba(74, 222, 128, 0.3);
}

.status-ongoing {
    color: var(--flash-color);
    background: rgba(254, 1, 154, 0.08);
    border-color: rgba(254, 1, 154, 0.3);
}

.status-planning {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.3);
}

.status-onhold {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.3);
}

/* Toast system */
.toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: calc(100vw - 2rem);
}

.toast-item {
    min-width: 300px;
    max-width: 420px;
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color: var(--white);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    opacity: 0;
    transform: translateX(100%);
    transition: transform 0.35s ease, opacity 0.35s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.toast-success {
    background: linear-gradient(135deg, #16a34a, #059669);
}

.toast-error {
    background: linear-gradient(135deg, #dc2626, #be185d);
}

.toast-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #1f1f1f;
}

.toast-info {
    background: linear-gradient(135deg, var(--flash-color), #d80086);
}

.toast-close {
    background: transparent;
    border: 0;
    color: inherit;
    opacity: 0.8;
    cursor: pointer;
    font-size: 1rem;
    margin-left: auto;
}

.toast-close:hover { opacity: 1; }

/* Modal base */
.fc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1055;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(6px);
}

.fc-modal {
    background: linear-gradient(135deg, #1a1a1a, #262626);
    border: 1px solid rgba(254, 1, 154, 0.25);
    color: var(--white);
    border-radius: 18px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
}

.fc-modal-lg {
    max-width: 860px;
}

.fc-modal-header {
    background: linear-gradient(135deg, var(--flash-color), rgba(254, 1, 154, 0.85));
    padding: 1.1rem 1.5rem;
    border-radius: 18px 18px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fc-modal-body {
    padding: 1.5rem;
}

.fc-modal-footer {
    padding: 1.1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.fc-modal-close {
    background: transparent;
    border: 0;
    color: var(--white);
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.fc-modal-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Scrollbar */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--primary-darker); }
::-webkit-scrollbar-thumb { background: var(--flash-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #ff4081; }

/* Selection */
::selection {
    background: var(--flash-color);
    color: var(--white);
}

/* Fade up on scroll */
.fade-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.in {
    opacity: 1;
    transform: translateY(0);
}

/* Utility for tight content text color */
.prose-inverted p,
.prose-inverted li {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.7;
}

.prose-inverted h3 {
    color: var(--white);
    margin-top: 1.4rem;
}

.prose-inverted strong {
    color: var(--white);
}

/* reCAPTCHA wrapper (dark tweak) */
.recaptcha-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 78px;
}

/* Stripe button container sizing */
#contribute stripe-buy-button {
    display: inline-block;
}

/* ==========================================================================
   Mermaid Flowcharts & Architecture Diagrams
   ========================================================================== */
.mermaid-card {
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.mermaid-card:hover {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.7), 0 0 25px rgba(254, 1, 154, 0.15);
}

/* Fullscreen Diagram Active State & Lightbox Overlay */
body.mermaid-fullscreen-active {
    overflow: hidden !important;
}

body.mermaid-fullscreen-active .glass {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.mermaid-card.is-fullscreen-active {
    position: fixed !important;
    inset: 0 !important;
    margin: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    border: none !important;
    display: flex !important;
    flex-direction: column !important;
    background: #09090d !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(254, 1, 154, 0.3) !important;
}

@media (min-width: 640px) {
    .mermaid-card.is-fullscreen-active {
        inset: 1rem !important;
        width: calc(100vw - 2rem) !important;
        height: calc(100vh - 2rem) !important;
        max-width: calc(100vw - 2rem) !important;
        max-height: calc(100vh - 2rem) !important;
        border-radius: 1rem !important;
        border: 1px solid rgba(254, 1, 154, 0.4) !important;
    }
}

@media (min-width: 1024px) {
    .mermaid-card.is-fullscreen-active {
        inset: 1.5rem !important;
        width: calc(100vw - 3rem) !important;
        height: calc(100vh - 3rem) !important;
        max-width: calc(100vw - 3rem) !important;
        max-height: calc(100vh - 3rem) !important;
        border-radius: 1rem !important;
    }
}

.mermaid-card.is-fullscreen-active .mermaid-container {
    flex: 1 1 0% !important;
    height: calc(100% - 56px) !important;
    max-height: calc(100% - 56px) !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    min-height: 0 !important;
}

/* Native HTML5 :fullscreen support */
.mermaid-card:fullscreen {
    position: fixed !important;
    inset: 0 !important;
    margin: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    z-index: 999999 !important;
    border-radius: 0 !important;
    border: none !important;
    background: #09090d !important;
    display: flex !important;
    flex-direction: column !important;
}

.mermaid-card:fullscreen .mermaid-container {
    flex: 1 1 0% !important;
    height: calc(100vh - 56px) !important;
    max-height: calc(100vh - 56px) !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    min-height: 0 !important;
}

.mermaid-container {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    scrollbar-width: thin;
    scrollbar-color: rgba(254, 1, 154, 0.4) rgba(255, 255, 255, 0.05);
}

.mermaid-container.cursor-grabbing {
    cursor: grabbing !important;
    user-select: none;
}

.mermaid-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.mermaid-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 9999px;
}

.mermaid-container::-webkit-scrollbar-thumb {
    background: rgba(254, 1, 154, 0.4);
    border-radius: 9999px;
}

.mermaid-container::-webkit-scrollbar-thumb:hover {
    background: rgba(254, 1, 154, 0.75);
}

/* Maintain crisp, legible font sizes across viewports instead of squishing text */
.mermaid-container .mermaid {
    min-width: 680px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (min-width: 1024px) {
    .mermaid-container .mermaid {
        min-width: 100%;
    }
}

.mermaid-container svg {
    max-width: 100% !important;
    height: auto !important;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
}

/* Node shapes & labels */
.mermaid-container .node rect,
.mermaid-container .node circle,
.mermaid-container .node ellipse,
.mermaid-container .node polygon,
.mermaid-container .node path {
    stroke-width: 1.5px !important;
    transition: filter 0.2s ease, stroke 0.2s ease, fill 0.2s ease;
}

.mermaid-container .node:hover rect,
.mermaid-container .node:hover circle,
.mermaid-container .node:hover polygon,
.mermaid-container .node:hover path {
    filter: drop-shadow(0 0 10px rgba(254, 1, 154, 0.7));
    stroke: #ff4ab4 !important;
}

/* Flowchart Links, Connections, and Lines (ALWAYS VISIBLE) */
.mermaid-container svg .flowchart-link,
.mermaid-container svg .edgePath path,
.mermaid-container svg path.flowchart-link,
.mermaid-container svg path.path,
.mermaid-container svg .edge-thickness-normal,
.mermaid-container svg .edge-thickness-thick {
    stroke: #fe019a !important;
    stroke-width: 2px !important;
    stroke-opacity: 1 !important;
    fill: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Arrowhead Markers & Endpoints (ALWAYS VISIBLE) */
.mermaid-container svg .marker,
.mermaid-container svg .arrowMarkerPath,
.mermaid-container svg marker path,
.mermaid-container svg .arrowheadPath {
    fill: #fe019a !important;
    stroke: #fe019a !important;
    stroke-opacity: 1 !important;
    fill-opacity: 1 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Edge Labels ('Yes', 'No', etc.) */
.mermaid-container .edgeLabel {
    background-color: #1a1625 !important;
    color: #ff4ab4 !important;
    border-radius: 6px;
    padding: 2px 7px;
    font-size: 11px !important;
    font-weight: 600;
    border: 1px solid rgba(254, 1, 154, 0.35);
}

.mermaid-container .edgeLabel rect {
    fill: #1a1625 !important;
    opacity: 0.9 !important;
}

/* ==========================================================================
   Responsive Code Snippets
   ========================================================================== */
.code-card {
    position: relative;
    max-width: 100%;
}

.code-card pre {
    margin: 0;
    padding: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    tab-size: 4;
}

.code-card pre code {
    font-family: inherit;
    font-size: 0.84rem;
    line-height: 1.65;
    tab-size: 4;
}

/* Custom sleek scrollbar for horizontal scroll when wrap is toggled off */
.code-content::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}
.code-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.code-content::-webkit-scrollbar-thumb {
    background: rgba(254, 1, 154, 0.35);
    border-radius: 9999px;
}
.code-content::-webkit-scrollbar-thumb:hover {
    background: rgba(254, 1, 154, 0.65);
}

/* Code snippet horizontal drag-to-scroll */
.code-content.code-draggable {
    cursor: grab;
}

.code-content.code-dragging {
    cursor: grabbing !important;
    user-select: none !important;
}

.code-content.code-dragging pre,
.code-content.code-dragging code {
    user-select: none !important;
}

/* ==========================================================================
   Back to Top Floating Button
   ========================================================================== */
#backToTopBtn {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(254, 1, 154, 0.35);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

#backToTopBtn:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.7), 0 0 25px rgba(254, 1, 154, 0.7);
}

