/* ================================================================
   AQuaMine Resources — Custom CSS
   Dùng cho: animation, custom components, styles Tailwind không
   handle tốt, và tiện ích dùng lại nhiều lần.
   ================================================================ */

/* ── Theme Variables ─────────────────────────────────────────── */
:root {
    --color-gray-50: 249, 250, 251;
    --color-gray-100: 243, 244, 246;
    --color-gray-200: 229, 231, 235;
    --color-gray-300: 209, 213, 219;
    --color-gray-400: 156, 163, 175;
    --color-gray-500: 107, 114, 128;
    --color-gray-600: 75, 85, 99;
    --color-gray-700: 55, 65, 81;
    --color-gray-800: 31, 41, 55;
    --color-gray-900: 17, 24, 39;
    --color-gray-950: 3, 7, 18;
    --color-white: 255, 255, 255;
    --color-black: 0, 0, 0;
    --bg-noise-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

html.light {
    --color-gray-950: 249, 250, 251;
    --color-gray-900: 255, 255, 255;
    --color-gray-800: 243, 244, 246;
    --color-gray-700: 229, 231, 235;
    --color-gray-600: 209, 213, 219;
    --color-gray-500: 156, 163, 175;
    --color-gray-400: 107, 114, 128;
    --color-gray-300: 75, 85, 99;
    --color-gray-200: 55, 65, 81;
    --color-gray-100: 31, 41, 55;
    --color-gray-50: 17, 24, 39;
    --color-white: 17, 24, 39;
    --color-black: 255, 255, 255;
    --bg-noise-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
}

html.light img[src$="logo.png"] {
    filter: invert(1);
}

html.light img[src$="background.jpg"] {
    filter: invert(1);
    opacity: 0.08 !important;
}

/* ── Custom scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgb(var(--color-gray-800));
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(var(--color-gray-700));
}

/* ── Text selection ──────────────────────────────────────────── */
::selection {
    background: rgba(34, 211, 238, 0.18);
    color: rgb(var(--color-white));
}

/* ── Focus ring ──────────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.55);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ── Skip link (accessibility) ───────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100px;
    left: 12px;
    padding: 8px 16px;
    background: #22d3ee;
    color: rgb(var(--color-gray-950));
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 0 0 8px 8px;
    z-index: 9999;
    transition: top 0.2s ease;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* ── Noise texture overlay ───────────────────────────────────── */
.noise-overlay {
    position: relative;
}

.noise-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--bg-noise-image);
    background-repeat: repeat;
    background-size: 128px;
    pointer-events: none;
    border-radius: inherit;
}

/* ── Toast notification ──────────────────────────────────────── */
.aquamine-toast {
    animation: toast-slide-in 0.28s cubic-bezier(0.34, 1.5, 0.64, 1) forwards;
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Card hover lift ─────────────────────────────────────────── */
.card-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-lift:hover {
    transform: translateY(-3px);
}

/* ── Resource card image zoom ────────────────────────────────── */
.resource-card .card-thumb {
    transition: transform 0.4s ease;
}

.resource-card:hover .card-thumb {
    transform: scale(1.05);
}

/* ── FAQ accordion ───────────────────────────────────────────── */
.faq-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.32s ease, opacity 0.25s ease;
    opacity: 0;
}

.faq-body.open {
    max-height: 600px;
    opacity: 1;
}

.faq-icon {
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.faq-open .faq-icon {
    transform: rotate(45deg);
}

/* ── Nav active link ─────────────────────────────────────────── */
.nav-link.active {
    color: #22d3ee !important;
}

.nav-link.active:hover {
    color: #67e8f9 !important;
}

/* Cyan / gradient / emerald CTA buttons: always white text (beats text-gray-950 + theme overrides) */
a.bg-cyan-500,
button.bg-cyan-500,
.bg-cyan-500,
a.from-cyan-500,
button.from-cyan-500,
a.bg-gradient-to-r.from-cyan-500,
button.bg-gradient-to-r.from-cyan-500,
a.bg-emerald-500,
button.bg-emerald-500,
.bg-emerald-500 {
    color: #ffffff !important;
}

a.bg-cyan-500:hover,
button.bg-cyan-500:hover,
.bg-cyan-500:hover,
a.from-cyan-500:hover,
button.from-cyan-500:hover,
a.bg-emerald-500:hover,
button.bg-emerald-500:hover,
.bg-emerald-500:hover {
    color: #ffffff !important;
}

a.bg-cyan-500 svg,
button.bg-cyan-500 svg,
a.from-cyan-500 svg,
button.from-cyan-500 svg,
a.bg-emerald-500 svg,
button.bg-emerald-500 svg {
    color: #ffffff !important;
    stroke: currentColor;
}

/* Extra strong override for any element with both cyan/emerald bg + text-gray-950 */
[class*="bg-cyan-500"][class*="text-gray-950"],
[class*="from-cyan-500"][class*="text-gray-950"],
[class*="bg-emerald-500"][class*="text-gray-950"] {
    color: #ffffff !important;
}

/* ── Gradient text (single accent) ──────────────────────────── */
.text-accent {
    color: #22d3ee;
}

/* ── Pricing featured card ───────────────────────────────────── */
.pricing-featured {
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.07) 0%, transparent 60%);
    border-color: rgba(34, 211, 238, 0.28) !important;
    position: relative;
    overflow: hidden;
}

.pricing-featured-badge {
    display: inline-block;
    background: #22d3ee;
    color: rgb(var(--color-gray-950));
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 0 0 8px 8px;
}

/* ── Step connector (horizontal timeline) ────────────────────── */
.step-line {
    position: relative;
}

.step-line:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 40px;
    left: calc(50% + 28px);
    right: calc(-50% + 28px);
    height: 1px;
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.25) 0%, transparent 100%);
}

/* ── Form inputs ─────────────────────────────────────────────── */
.form-input {
    width: 100%;
    background: rgba(var(--color-white), 0.04);
    border: 1px solid rgba(var(--color-white), 0.08);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.875rem;
    color: rgb(var(--color-gray-100));
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

.form-input::placeholder {
    color: rgba(100, 116, 139, 0.7);
}

.form-input option {
    background: rgb(var(--color-gray-800));
    color: rgb(var(--color-gray-100));
}

/* ── Section with subtle top glow ────────────────────────────── */
.glow-top {
    position: relative;
}

.glow-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.15), transparent);
}

/* ── Responsive utilities ────────────────────────────────────── */
@media (max-width: 640px) {
    .step-line::after {
        display: none;
    }
}

/* ── Filter buttons ──────────────────────────────────────────── */
.filter-btn {
    cursor: pointer;
    border: 1px solid;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
}

.filter-btn.filter-active {
    background-color: #22d3ee;
    color: #ffffff !important;
    border-color: #22d3ee;
}

.filter-btn.filter-inactive {
    background-color: rgba(var(--color-white), 0.05);
    color: rgb(var(--color-gray-300));
    border-color: rgba(var(--color-white), 0.1);
}

.filter-btn.filter-inactive:hover {
    border-color: rgba(34, 211, 238, 0.35);
    color: rgb(var(--color-white));
}

/* Glassmorphism card */
.glass-card {
    background: rgba(var(--color-white), 0.04);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--color-white), 0.12);
    border-radius: 0.75rem;
    /* rounded-2xl equivalent */
    padding: 1.5rem;
    /* p-6 equivalent */
}

/* Button press animation */
@keyframes btn-press {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(2px);
    }
}

.btn-press {
    animation: btn-press 0.1s ease-out;
}

/* ── Nav link active state (dùng chung mọi trang) ───────────── */
.nav-link.active {
    color: #FCD05C !important;
    background: rgba(252, 208, 92, 0.10);
}
