@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap');

body {
    box-sizing: border-box;
    font-family: 'Nunito Sans', sans-serif;
}

.hero-bg {
    background: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.2)), 
                url('../images/main.png');
    background-size: cover;
    background-position: center;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-content.active {
    max-height: 1000px;
}

/* Enhanced accordion content padding */
.accordion-content > div {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Additional padding for nested content in accordions */
.accordion-content .px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.news-carousel {
    scroll-behavior: smooth;
}

/* Flip Clock Styles - Based on CodePen example */
/* Core layout */
.flip-clock {
    text-align: center;
    perspective: 400px;
    -webkit-perspective: 400px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

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

.flip-clock__piece {
    display: inline-block;
}

.flip-clock__slot {
    display: block;
    font-size: clamp(12px, 2vw, 18px);
    color: #e5e7eb; /* tailwind gray-200 */
    margin-top: 0.25rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Card sizing and halves */
.card {
    display: block;
    position: relative;
    padding-bottom: 0.72em; /* half height */
    font-size: clamp(28px, 8vw, 72px);
    line-height: 0.95;
    width: 1.8em;
}

.card__top,
.card__bottom,
.card__back::before,
.card__back::after {
    display: block;
    height: 0.72em;
    color: #cccccc;
    background: #222222;
    padding: 0.25em 0.25em;
    border-radius: 0.15em 0.15em 0 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    width: 1.8em;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.card__bottom {
    color: #ffffff;
    position: absolute;
    top: 50%;
    left: 0;
    border-top: solid 1px #000000;
    background: #393939;
    border-radius: 0 0 0.15em 0.15em;
    pointer-events: none;
    overflow: hidden;
}

.card__bottom::after {
    display: block;
    margin-top: -0.72em;
}

.card__back::before,
.card__bottom::after {
    content: attr(data-value);
}

.card__back {
    position: absolute;
    top: 0;
    height: 100%;
    left: 0;
    pointer-events: none;
}

.card__back::before {
    position: relative;
    z-index: -1;
    overflow: hidden;
}

.flip .card__back::before {
    animation: flipTop 0.3s cubic-bezier(.37,.01,.94,.35);
    -webkit-animation: flipTop 0.3s cubic-bezier(.37,.01,.94,.35);
    animation-fill-mode: both;
    -webkit-animation-fill-mode: both;
    transform-origin: center bottom;
    -webkit-transform-origin: center bottom;
}

.flip .card__back .card__bottom {
    transform-origin: center top;
    animation-fill-mode: both;
    animation: flipBottom 0.6s cubic-bezier(.15,.45,.28,1);
    -webkit-transform-origin: center top;
    -webkit-animation-fill-mode: both;
    -webkit-animation: flipBottom 0.6s cubic-bezier(.15,.45,.28,1);
}

@keyframes flipTop {
    0% {
        transform: rotateX(0deg);
        z-index: 2;
    }
    0%, 99% {
        opacity: 0.99;
    }
    100% {
        transform: rotateX(-90deg);
        opacity: 0;
    }
}

@keyframes flipBottom {
    0%, 50% {
        z-index: -1;
        transform: rotateX(90deg);
        opacity: 0;
    }
    51% {
        opacity: 0.99;
    }
    100% {
        opacity: 0.99;
        transform: rotateX(0deg);
        z-index: 5;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .flip-clock {
        gap: 0.6rem;
        flex-wrap: nowrap; /* keep in one row */
    }
    
    .flip-clock .card {
        font-size: clamp(24px, 10vw, 56px);
    }
    
    .flip-clock__slot {
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    .flip-clock {
        gap: 0.45rem;
    }
    
    .flip-clock .card {
        font-size: clamp(22px, 11vw, 44px);
    }
    
    .flip-clock__slot {
        font-size: 0.75rem;
    }
}

/* Mobile-specific styles */
@media (max-width: 767px) {
    /* Ensure logos are always visible and properly sized */
    .header-logos img {
        max-height: 2rem;
        width: auto;
    }
    
    /* Mobile menu animation */
    #mobile-menu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
        opacity: 0;
    }
    
    #mobile-menu:not(.hidden) {
        max-height: 500px;
        opacity: 1;
    }
    
    /* Hamburger button hover effect */
    #mobile-menu-button:hover {
        background-color: #f3f4f6;
    }
    
    /* Mobile navigation links */
    #mobile-menu nav a {
        padding: 0.75rem 0;
        border-bottom: 1px solid #f3f4f6;
        transform: translateY(-10px);
        opacity: 0;
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    }
    
    #mobile-menu:not(.hidden) nav a {
        transform: translateY(0);
        opacity: 1;
    }
    
    #mobile-menu nav a:last-child {
        border-bottom: none;
    }
    
    /* Mobile contact section */
    #mobile-menu .pt-3 {
        padding-top: 1rem;
        transform: translateY(-10px);
        opacity: 0;
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    }
    
    #mobile-menu:not(.hidden) .pt-3 {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Ensure proper spacing for mobile logos */
@media (max-width: 640px) {
    .header-logos {
        gap: 0.5rem;
    }
    
    .header-logos img {
        max-height: 1.75rem;
    }
}

/* Mobile Regulations Section Styles */
@media (max-width: 1023px) {
    /* Mobile section selector */
    #mobile-section-selector {
        font-size: 0.875rem;
        padding: 0.75rem;
    }
    
    /* Mobile content adjustments */
    .section-content {
        padding: 1rem;
    }
    
    .section-content h2 {
        font-size: 1.5rem;
        line-height: 1.4;
        margin-bottom: 1rem;
    }
    
    .section-content p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    /* Mobile accordion improvements */
    .accordion-content {
        font-size: 0.85rem;
    }
    
    .accordion-content > div {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    
    .accordion-content .px-6 {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }
    
    .accordion-content ol,
    .accordion-content ul {
        padding-left: 1rem;
    }
    
    .accordion-content li {
        margin-bottom: 0.5rem;
        line-height: 1.5;
    }
}

/* Extra small mobile adjustments */
@media (max-width: 640px) {
    .section-content {
        padding: 0.75rem;
    }
    
    .section-content h2 {
        font-size: 1.25rem;
    }
    
    .section-content p {
        font-size: 0.85rem;
    }
    
    /* Mobile accordion button adjustments */
    .border.border-gray-200.rounded-lg button {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .accordion-content {
        font-size: 0.8rem;
    }
    
    .accordion-content > div {
        padding-top: 1rem;
        padding-bottom: 1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .accordion-content .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

/* Reveal on scroll animation for sections */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1400ms ease, transform 1400ms ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Prevent hero/news flash on first paint until JS attaches reveal */
html.reveal-init #about .max-w-4xl,
html.reveal-init #about h1,
html.reveal-init #about p,
html.reveal-init #about button,
html.reveal-init #newsCarousel > *,
html.reveal-init section.py-16.bg-white h2 {
    opacity: 0;
    transform: translateY(20px);
}

/* Button color shift effects */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* For hero button with gradient */
.color-shift-gradient {
    background-image: linear-gradient(90deg, #7c3aed, #2563eb, #7c3aed);
    background-size: 200% 200%;
}

.color-shift-gradient:hover,
.color-shift-gradient:focus-visible {
    animation: gradientShift 1400ms ease forwards;
}

/* For CTA link: transition from white to animated gradient background */
.color-shift-solid {
    background-color: #ffffff;
}

.color-shift-solid:hover,
.color-shift-solid:focus-visible {
    background-image: linear-gradient(90deg, #7c3aed, #2563eb, #7c3aed);
    background-size: 200% 200%;
    animation: gradientShift 1400ms ease forwards;
    color: #ffffff !important;
}

@media (prefers-reduced-motion: reduce) {
    .color-shift-gradient:hover,
    .color-shift-gradient:focus-visible {
        animation: none;
    }
    /* Reduced motion: no animated background */
    .color-shift-solid:hover,
    .color-shift-solid:focus-visible {
        animation: none;
    }
}

/* Application Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal-backdrop:not(.hidden) {
    opacity: 1;
}

.modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease-in-out;
}

.modal-backdrop:not(.hidden) .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 0 1.5rem;
}

.modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background-color: #fef3c7;
    border-radius: 50%;
    flex-shrink: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-content {
    padding: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 1rem 0;
}

.modal-message {
    color: #4b5563;
    line-height: 1.6;
    margin: 0;
    font-size: 1rem;
}

.modal-footer {
    padding: 0 1.5rem 1.5rem 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.modal-continue-btn {
    background-color: #dc2626;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.modal-continue-btn:hover {
    background-color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

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

/* Mobile responsive adjustments for modal */
@media (max-width: 640px) {
    .modal-container {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header {
        padding: 1rem 1rem 0 1rem;
    }
    
    .modal-content {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0 1rem 1rem 1rem;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .modal-message {
        font-size: 0.9rem;
    }
    
    .modal-continue-btn {
        width: 100%;
        padding: 0.875rem 1rem;
    }
}

/* Accessibility improvements */
.modal-backdrop.hidden {
    display: none;
}

/* Focus management for accessibility */
.modal-close:focus,
.modal-continue-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Animation for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .modal-backdrop,
    .modal-container,
    .modal-continue-btn {
        transition: none;
    }
}
