/**
 * @fileoverview Homepage Styles for Chahua Web Store Landing Page
 * @description Hero section, feature showcases, and landing page components with modern design
 * @dependencies 
 *   - global.css (CSS variables and base styles)
 *   - components.css (reusable UI components)
 * @features
 *   - Hero section with gradient background and grid effects
 *   - Feature showcase cards with hover animations
 *   - Call-to-action buttons and sections
 *   - Responsive design for all devices
 *   - Modern typography with gradient text effects
 * @animations
 *   - Background grid subtle animations
 *   - Card hover transformations
 *   - Text gradient animations
 * @performance 
 *   - Optimized for fast loading
 *   - CSS-only animations for smooth experience
 *   - Responsive images and content
 * @calledBy index.html
 * @example
 * // Hero section structure:
 * <section class="hero">
 *   <div class="hero-content">
 *     <h1 class="page-title">Welcome</h1>
 *   </div>
 * </section>
 */



/* Page Header */
.page-header {
    padding: 4rem 0;
    background: var(--gradient-primary);
    text-align: center;
}

.page-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--text-primary), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Hero Section V2 */
.hero {
    width: 100%;
    padding: 3rem 0 6rem 0;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative; /* เพิ่ม position relative */
    overflow: hidden;
}

/* เพิ่ม: Background Grid effect */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.5;
    z-index: 0;
}

.hero-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    position: relative; /* เพิ่ม z-index ให้สูงกว่า background */
    z-index: 1;
}

.hero-image {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    order: 1;
    position: relative;
    background: var(--glass-bg);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
}

.hero-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.1), transparent);
    transition: left 0.8s ease;
}

.hero-image:hover::before {
    left: 100%;
}

/* เพิ่ม: แสง Glow ด้านหลังรูปภาพ */
.hero-bg-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.3), transparent 70%);
    opacity: 0.6;
    border-radius: 50%;
    animation: gentle-pulse 4s ease-in-out infinite;
}

@keyframes gentle-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.hero-img {
    width: 100%;
    max-width: 600px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 15px 35px rgba(14, 165, 233, 0.4));
    animation: gentle-float 8s ease-in-out infinite; 
    cursor: zoom-in;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
    border-radius: 12px;
}

.hero-img:hover {
    filter: drop-shadow(0 20px 45px rgba(14, 165, 233, 0.6));
    transform: translateY(-5px);
}

.hero-img.zoomed {
    transform: scale(2);
    animation-play-state: paused;
    cursor: zoom-out;
    z-index: 101;
    filter: drop-shadow(0 25px 60px rgba(14, 165, 233, 0.8));
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    max-width: 600px;
    order: 2;
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    color: var(--text-primary);
}

.hero-accent {
    color: var(--accent-blue);
    text-shadow: 0 0 15px var(--shadow-color); /* เพิ่มเงาให้ดูเด่น */
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-break {
    display: none;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

/* Keyframe สำหรับ Animation ใหม่ */
@keyframes gentle-float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Button Styles for Hero Section */
.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before,
.btn-secondary:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-light));
    color: white;
    border: 1px solid var(--glass-border);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-blue-hover), var(--accent-blue));
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-light));
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

/* Features Section V2 */
.features {
    padding: 5rem 0;
    background: var(--bg-secondary);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem; /* เพิ่มระยะห่าง */
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* ปรับ minmax */
    gap: 2rem;
    padding: 0 1.5rem;
}

.feature-item {
    background: var(--glass-bg);
    padding: 2.5rem 2rem;
    text-align: center;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.05), transparent);
    transition: left 0.6s ease;
}

.feature-item:hover::before {
    left: 100%;
}

/* เพิ่ม Hover effect แบบมี Glow */
.feature-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-glow-strong);
    border-color: var(--accent-blue);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
}

/* เพิ่ม: สไตล์สำหรับไอคอน */
.feature-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    color: var(--accent-blue);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1;
}

.feature-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.2), transparent);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.feature-item:hover .feature-icon::before {
    opacity: 1;
}

.feature-item:hover .feature-icon {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
    color: var(--accent-light);
}

.feature-icon svg {
    width: 32px;
    height: 32px;
}

.feature-item h3 {
    color: var(--text-primary); /* เปลี่ยนสีให้เด่นขึ้น */
    margin-bottom: 1rem;
    font-size: 1.25rem; /* เพิ่มขนาดเล็กน้อย */
}

.feature-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Hero Image Animation */
@keyframes float-spin-zoom {
    0% {
        transform: translateY(0px) rotateY(0deg) scale(1);
    }
    50% {
        transform: translateY(-10px) rotateY(180deg) scale(1.1);
    }
    100% {
        transform: translateY(0px) rotateY(360deg) scale(1);
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border: 2px solid var(--accent-blue);
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    color: var(--accent-blue);
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--accent-blue);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.1);
}

.btn-submit {
    padding: 1rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-submit:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-2px);
}

.modal-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.modal-footer p {
    color: var(--text-secondary);
}

.link-btn {
    background: none;
    border: none;
    color: var(--accent-blue);
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.link-btn:hover {
    color: var(--accent-blue-hover);
}

/* Social Login Section */
.social-login-section {
    margin-bottom: 1.5rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-btn:hover {
    border-color: var(--accent-blue);
    background: rgba(0, 170, 255, 0.1);
}

.social-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: var(--border-color);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider span {
    background: var(--bg-secondary);
    padding: 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Turnstile Container - แทนที่ CAPTCHA */
.turnstile-container {
    margin: 1rem 0;
    min-height: 40px;
    display: flex;
    justify-content: center;
}

/* Modal Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to { 
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Responsive Layouts */
@media (min-width: 1024px) {
    .hero-container {
        flex-direction: row;
        justify-content: space-between;
        gap: 4rem;
        padding: 0 1.5rem;
    }
    
    .hero-image {
        order: 2;
        padding: 1.5rem;
        flex: 1;
    }
    
    .hero-img {
        max-width: 500px;
    }
    
    .hero-content {
        order: 1;
        text-align: left;
        flex: 1;
        max-width: none;
    }
    
    .hero-title {
        font-size: 3.75rem;
    }
    
    .hero-break {
        display: inline;
    }
    
    .hero-actions {
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-actions {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }
}

@media (max-width: 768px) {

    /* ⚡ Performance: Optimize other mobile elements */
    .hero-container {
        padding: 0 1rem;
        margin: 0;
        width: 100%;
        text-align: center;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-img {
        max-width: 100%;
        height: auto;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
        margin: 0;
        width: 100%;
    }

    .feature-item {
        padding: 1.5rem;
    }

    .container {
        padding: 0 1rem;
        margin: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .feature-item h3 {
        font-size: 1.2rem;
    }
}

/* Footer Styles */
/* =============================================== */
/* ===           MOBILE NAVIGATION              === */
/* =============================================== */


