/* ========================================
   HHPoker Main Stylesheet
   ======================================== */

/* ---- Base & Reset ---- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background-color: #030712;
    overflow-x: hidden;
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #111827;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4f46e5, #7c3aed);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
}

/* ---- Selection ---- */
::selection {
    background-color: rgba(79, 70, 229, 0.3);
    color: #ffffff;
}

/* ---- Animations ---- */

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Count Up Pulse */
@keyframes countPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Glow Pulse */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(79, 70, 229, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(79, 70, 229, 0.6);
    }
}

/* Shimmer */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Slide Down (for mobile menu) */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        max-height: 500px;
    }
    to {
        opacity: 0;
        max-height: 0;
    }
}

/* ---- Animation Utility Classes ---- */
.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.8s ease-out forwards;
    opacity: 0;
}

.animate-fadeInRight {
    animation: fadeInRight 0.8s ease-out forwards;
    opacity: 0;
}

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

.animate-glowPulse {
    animation: glowPulse 2s ease-in-out infinite;
}

/* Staggered animation delays for data-animate elements */
[data-animate="fadeInUp"][data-delay="100"] { animation-delay: 0.1s; }
[data-animate="fadeInUp"][data-delay="200"] { animation-delay: 0.2s; }
[data-animate="fadeInUp"][data-delay="300"] { animation-delay: 0.3s; }
[data-animate="fadeInUp"][data-delay="400"] { animation-delay: 0.4s; }
[data-animate="fadeInUp"][data-delay="500"] { animation-delay: 0.5s; }
[data-animate="fadeInLeft"][data-delay="100"] { animation-delay: 0.1s; }
[data-animate="fadeInLeft"][data-delay="200"] { animation-delay: 0.2s; }
[data-animate="fadeInLeft"][data-delay="300"] { animation-delay: 0.3s; }
[data-animate="fadeInRight"][data-delay="100"] { animation-delay: 0.1s; }
[data-animate="fadeInRight"][data-delay="200"] { animation-delay: 0.2s; }
[data-animate="fadeInRight"][data-delay="300"] { animation-delay: 0.3s; }

/* ---- Navbar Styles ---- */
#navbar.scrolled {
    background: rgba(3, 7, 18, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

#navbar .nav-link-active {
    color: #a5b4fc;
    background: rgba(255, 255, 255, 0.1);
}

/* ---- Mobile Menu ---- */
#mobile-menu.show {
    display: block;
    animation: slideDown 0.3s ease-out forwards;
}

#mobile-menu.hide {
    animation: slideUp 0.3s ease-out forwards;
}

/* ---- Hero Split Layout ---- */
@media (max-width: 1023px) {
    .hero-split {
        flex-direction: column;
    }
}

/* ---- Feature Cards ---- */
.feature-card .icon-circle {
    transition: transform 0.3s ease;
}

.feature-card:hover .icon-circle {
    transform: scale(1.1);
}

.feature-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

/* ---- Gradient Icon Circles ---- */
.icon-gradient-circle {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%);
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
}

/* ---- Stats Counter Styles ---- */
.counter {
    display: inline-block;
}

.counter.counting {
    animation: countPulse 0.3s ease-out;
}

/* ---- FAQ Accordion ---- */
.faq-item .faq-toggle {
    cursor: pointer;
    user-select: none;
}

.faq-item .faq-toggle i {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-toggle i {
    transform: rotate(180deg);
}

.faq-item.active {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(31, 41, 55, 0.5);
}

.faq-item .faq-content {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 0;
}

.faq-item.active .faq-content {
    max-height: 500px;
    opacity: 1;
}

/* ---- Diagonal CTA Background ---- */
.cta-diagonal {
    position: relative;
    overflow: hidden;
}

.cta-diagonal::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 0;
    width: 100%;
    height: 200%;
    background: linear-gradient(165deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%);
    transform: skewY(-3deg);
    transform-origin: top left;
    z-index: 0;
}

.cta-diagonal > * {
    position: relative;
    z-index: 1;
}

/* ---- Testimonials ---- */
.testimonial-card {
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

/* ---- Form Styles ---- */
input:focus, textarea:focus, select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

input.error, textarea.error, select.error {
    border-color: #ef4444;
}

input.success, textarea.success, select.success {
    border-color: #22c55e;
}

.form-error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

.form-error-message.show {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

/* ---- Select Dropdown Custom Styling ---- */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em;
    padding-right: 2.5rem;
}

/* ---- Table Styles ---- */
table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 0.75rem;
}

table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 0.75rem;
}

/* ---- Download Cards ---- */
.download-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.download-card:hover {
    transform: translateY(-6px);
}

/* ---- Timeline ---- */
.timeline-dot {
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.5);
}

.timeline-line {
    background: linear-gradient(180deg, rgba(79, 70, 229, 0.5), rgba(79, 70, 229, 0.05));
}

/* ---- Social Icons Hover ---- */
.social-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
}

/* ---- Button Hover Effects ---- */
.btn-gradient {
    background-size: 100% 100%;
    background-position: 0 0;
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    background-size: 150% 100%;
}

/* ---- Glass Effect ---- */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---- Mobile Responsive Adjustments ---- */

@media (max-width: 640px) {
    /* Hero adjustments */
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    /* Feature cards */
    .feature-card {
        padding: 1.5rem;
    }

    /* Section padding */
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    /* Stats */
    .stat-number {
        font-size: 2rem;
    }

    /* FAQ */
    .faq-toggle span {
        font-size: 0.95rem;
    }

    /* Footer */
    footer .grid {
        gap: 2rem;
    }

    /* Form */
    #contact-form .grid {
        grid-template-columns: 1fr;
    }

    /* Timeline */
    .timeline-content {
        padding-left: 1rem;
    }

    /* Page banners */
    .page-banner h1 {
        font-size: 2rem;
    }

    /* Download cards */
    .download-card {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Navbar */
    #navbar .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Hero CTA buttons */
    .hero-cta-group {
        flex-direction: column;
        width: 100%;
    }

    .hero-cta-group a {
        width: 100%;
        justify-content: center;
    }

    /* Features grid */
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Features grid */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---- Scroll-triggered animations via JS ---- */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.from-bottom {
    transform: translateY(40px);
}

.animate-on-scroll.from-left {
    transform: translateX(-50px);
}

.animate-on-scroll.from-right {
    transform: translateX(50px);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translate(0);
}

/* ---- Loading / Skeleton States ---- */
.skeleton {
    background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

/* ---- Star Ratings ---- */
.stars {
    color: #eab308;
}

/* ---- Toast / Notification ---- */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    color: #fff;
    font-size: 0.875rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-color: #22c55e;
}

.toast.error {
    border-color: #ef4444;
}

/* ---- Back to Top Button ---- */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 40;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
    border: none;
}

#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

#back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.6);
}

/* ---- Ripple Effect for Buttons ---- */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10%);
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.5s, transform 0.5s;
    transform: scale(10);
}

.ripple:active::after {
    opacity: 1;
    transform: scale(0);
    transition: 0s;
}

/* ---- Print Styles ---- */
@media print {
    nav, footer, #back-to-top, .toast {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}

/* ---- Focus Visible (Accessibility) ---- */
:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
