/* Shared custom styles used across pages.
   Tailwind (via CDN + tailwind.config.js) handles utilities; anything here
   is behavior Tailwind's utility classes can't express (custom keyframes,
   compound hover states, repeated background-image patterns). */

/* Buttons.
   Size, radius, width and font stay as Tailwind utilities on the element -
   these classes only carry the shared look (gradient, rim, sheen, focus ring),
   so one class fits the navbar pill, a modal submit and a hero CTA alike. */
.btn-primary {
    position: relative;
    overflow: hidden;
    color: #fff;
    background-image: linear-gradient(to right, #00a16c, #007447);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 10px 35px -8px rgba(0, 161, 108, .6);
    transition: transform .3s ease, box-shadow .3s ease;
}

/* Light sweeps across on hover */
.btn-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(to right, transparent, rgba(255, 255, 255, .25), transparent);
    transform: translateX(-100%);
    transition: transform .7s ease-out;
}

.btn-primary:hover::before {
    transform: translateX(100%);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3), 0 16px 50px -8px rgba(0, 161, 108, .75);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Two-tone ring so focus stays visible on both white and gray-950 backdrops */
.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #007447;
}

/* Secondary, light backgrounds. Rim is an inset shadow rather than a border so
   it lines up pixel-for-pixel with .btn-primary at the same padding. */
.btn-outline {
    color: #374151;
    background-color: #fff;
    box-shadow: inset 0 0 0 1px #e5e7eb;
    transition: transform .3s ease, color .3s ease, background-color .3s ease, box-shadow .3s ease;
}

.btn-outline:hover {
    color: #007447;
    background-color: #e8f8f3;
    box-shadow: inset 0 0 0 1px #9ce5cc, 0 6px 20px -8px rgba(0, 161, 108, .45);
    transform: translateY(-2px);
}

.btn-outline:active {
    transform: translateY(0);
}

.btn-outline:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 1px #e5e7eb, 0 0 0 2px #fff, 0 0 0 4px #007447;
}

/* Secondary, dark backgrounds only */
.btn-ghost {
    color: #e5e7eb;
    background-color: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    backdrop-filter: blur(4px);
    transition: transform .3s ease, color .3s ease, background-color .3s ease, border-color .3s ease;
}

.btn-ghost:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .25);
    transform: translateY(-2px);
}

.btn-ghost:active {
    transform: translateY(0);
}

.btn-ghost:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .6), 0 0 0 4px #fff;
}

@media (prefers-reduced-motion: reduce) {

    .btn-primary,
    .btn-outline,
    .btn-ghost,
    .btn-primary::before {
        transition: none;
    }

    .btn-primary:hover,
    .btn-outline:hover,
    .btn-ghost:hover {
        transform: none;
    }

    .btn-primary:hover::before {
        transform: translateX(-100%);
    }
}

/* Modals become bottom sheets on phones. Layout (full-bleed, rounded top only,
   bottom-aligned) is done with Tailwind responsive utilities in the markup;
   this only swaps the desktop scale-in for a slide-up, reusing the very same
   scale-95 / scale-100 classes main.js already toggles. */
@media (max-width: 639px) {
    .modal-sheet {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .modal-sheet.scale-95 {
        transform: translateY(100%);
    }

    .modal-sheet.scale-100 {
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal-sheet.transition-transform {
        transition: none;
    }
}

/* Long-form article body. One class on the wrapper instead of utilities on every
   paragraph and heading - the vertical rhythm then comes from a single source
   rather than `space-y-6` and per-element `mt-*` overriding each other. */
.article-body {
    color: #374151;
    font-size: 1.0625rem;
    line-height: 1.75;
}

.article-body> * + * {
    margin-top: 1.5rem;
}

.article-body .lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #1f2937;
}

.article-body h2 {
    margin-top: 3rem;
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -.01em;
    color: #111827;
    scroll-margin-top: 6rem;
}

.article-body h3 {
    margin-top: 2rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

/* A heading belongs to the text under it */
.article-body h2 + p,
.article-body h3 + p {
    margin-top: .75rem;
}

.article-body a {
    color: #007447;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .2s ease;
}

.article-body a:hover {
    color: #005c37;
}

.article-body ul,
.article-body ol {
    padding-left: 1.5rem;
}

.article-body ul {
    list-style: disc;
}

.article-body ol {
    list-style: decimal;
}

.article-body li + li {
    margin-top: .5rem;
}

.article-body blockquote {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background-color: #e8f8f3;
    border-left: 4px solid #00a16c;
    border-radius: 0 .75rem .75rem 0;
}

.article-body blockquote p {
    margin-top: 0;
    font-size: 1.125rem;
    font-style: italic;
    color: #1f2937;
}

.article-body blockquote cite {
    display: block;
    margin-top: .75rem;
    font-size: .875rem;
    font-style: normal;
    color: #6b7280;
}

.article-body .callout {
    margin-top: 2.5rem;
}

@media (min-width: 640px) {
    .article-body {
        font-size: 1.125rem;
    }

    .article-body .lead {
        font-size: 1.375rem;
    }

    .article-body h2 {
        font-size: 1.875rem;
    }
}

/* Checkout progress steps. State is a class on the <li> so the JS toggles one
   thing per step instead of juggling half a dozen utilities. */
.checkout-step {
    color: #9ca3af;
}

.checkout-step-dot {
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #9ca3af;
    transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}

.checkout-step.is-done .checkout-step-dot {
    background-color: #e8f8f3;
    border-color: #9ce5cc;
    color: #007447;
}

.checkout-step.is-active {
    color: #111827;
    font-weight: 600;
}

.checkout-step.is-active .checkout-step-dot {
    background-color: #008956;
    border-color: #008956;
    color: #fff;
}

/* Invalid-voucher shake (used as .animate-shake and as an inline animation name) */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

.animate-shake {
    animation: shake .5s ease-in-out;
}

/* Trailing dots while a voucher is validating */
@keyframes dots {
    0% {
        clip-path: inset(0 100% 0 0);
    }

    100% {
        clip-path: inset(0 0 0 0);
    }
}

.dot-animation {
    display: inline-block;
    animation: dots 1.2s steps(4, end) infinite;
}

/* Payment method radio card. `:has` reads the checked state straight from the
   input, so the selected style needs no JS class swapping. */
.payment-method-option {
    border: 2px solid #e5e7eb;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.payment-method-option:hover {
    border-color: #d1d5db;
}

.payment-method-option:has(input:checked) {
    border-color: #00a16c;
    background-color: #e8f8f3;
}

.payment-method-option:has(input:focus-visible) {
    box-shadow: 0 0 0 3px rgba(0, 161, 108, .25);
}

/* Curriculum accordion is a native <details>; only the default marker needs hiding */
.curriculum-module > summary,
.voucher-details > summary,
.payment-steps > summary {
    list-style: none;
}

.curriculum-module > summary::-webkit-details-marker,
.voucher-details > summary::-webkit-details-marker,
.payment-steps > summary::-webkit-details-marker {
    display: none;
}

/* Horizontal scroller without the scrollbar (category chips) */
.no-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Filter chip on a dark backdrop. State lives in data-active so the JS toggles
   one attribute instead of swapping a whole className. */
.blog-chip {
    color: #9ca3af;
    background-color: rgba(255, 255, 255, .05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
    transition: color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.blog-chip:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, .1);
}

.blog-chip[data-active="true"] {
    color: #fff;
    background-color: #007447;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}

.blog-chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #030712, 0 0 0 4px #fff;
}

/* Card hover lift */
.card-lift {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

.card-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Blog card */
.blog-card {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.1);
}

.blog-card .card-img {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.blog-card:hover .card-img {
    transform: scale(1.08);
}

.blog-card .card-overlay {
    transition: opacity 0.35s ease;
    opacity: 0;
}

.blog-card:hover .card-overlay {
    opacity: 1;
}

.blog-card .card-arrow {
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(-4px);
    opacity: 0;
}

.blog-card:hover .card-arrow {
    transform: translateX(0);
    opacity: 1;
}

.blog-card .card-link {
    transition: gap 0.3s ease;
}

.blog-card:hover .card-link {
    gap: 0.5rem;
}

/* Glass card shimmer */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
}

/* Floating animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-12px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delay {
    animation: float 6s ease-in-out 2s infinite;
}

/* Marquee */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.animate-marquee {
    animation: marquee 30s linear infinite;
}

/* Counter animation */
.stat-number {
    transition: all 0.3s ease;
}

.stat-number:hover {
    transform: scale(1.05);
}

/* Testimonial card */
.testimonial-card {
    transition: all 0.35s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(99, 102, 241, 0.15);
}

/* Generic fade-in (login/register modal + misc) */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.2s ease-out;
}

/* Login/register modal swap transition */
#login-modal.hidden + #register-modal:not(.hidden) ~ * #login-modal-content,
#register-modal:not(.hidden) #register-modal-content {
    opacity: 1;
    transform: scale(1);
}

/* Decorative grid-line background (repeated across hero/section backdrops) */
.bg-grid-pattern {
    background-image: linear-gradient(rgba(255, 255, 255, .1) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .1) 1px, transparent 1px);
    background-size: 60px 60px;
}

.bg-grid-pattern-sm {
    background-image: linear-gradient(rgba(255, 255, 255, .1) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .1) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Decorative dot background */
.bg-dot-pattern {
    background-image: radial-gradient(circle at 2px 2px, white 1px, transparent 0);
    background-size: 20px 20px;
}

.bg-dot-pattern-lg {
    background-image: radial-gradient(circle at 2px 2px, white 1px, transparent 0);
    background-size: 24px 24px;
}
