/**
 * ระบบสอบย้อนกลับผักอุดร - Hero Section CSS
 * ==============================================
 * Dedicated styles for carousel hero section
 */

/* ========================================
   Hero Section Core Styles
   ======================================== */

.hero-section {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.hero-section .carousel {
    height: 100vh;
    position: relative;
}

.hero-section .carousel-inner,
.hero-section .carousel-item {
    height: 100%;
}

/* ========================================
   Slide Background Styles
   ======================================== */

.hero-slide {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Individual slide backgrounds */
.hero-slide.slide-1 {
    background-image: 
        linear-gradient(135deg, rgba(25, 135, 84, 0.85), rgba(32, 201, 151, 0.75)),
        url('../images/hero-slide-1.jpg');
}

.hero-slide.slide-2 {
    background-image: 
        linear-gradient(135deg, rgba(13, 110, 253, 0.85), rgba(25, 135, 84, 0.75)),
        url('../images/hero-slide-2.jpg');
}

.hero-slide.slide-3 {
    background-image: 
        linear-gradient(135deg, rgba(111, 66, 193, 0.85), rgba(13, 110, 253, 0.75)),
        url('../images/hero-slide-3.jpg');
}

/* Fallback backgrounds for missing images */
.hero-slide.slide-1:not([style*="background-image"]) {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.9), rgba(32, 201, 151, 0.8)),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23198754"/><circle cx="20" cy="20" r="2" fill="%23ffffff" opacity="0.3"/><circle cx="80" cy="30" r="1.5" fill="%23ffffff" opacity="0.2"/><circle cx="30" cy="70" r="2.5" fill="%23ffffff" opacity="0.25"/></svg>');
}

.hero-slide.slide-2:not([style*="background-image"]) {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.9), rgba(25, 135, 84, 0.8)),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23074bd1"/><rect x="40" y="40" width="20" height="20" fill="%23ffffff" opacity="0.2"/><rect x="45" y="45" width="10" height="10" fill="%23000000" opacity="0.3"/></svg>');
}

.hero-slide.slide-3:not([style*="background-image"]) {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.9), rgba(13, 110, 253, 0.8)),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" fill="%236f42c1"/><rect x="10" y="20" width="80" height="60" fill="%23ffffff" opacity="0.1" rx="5"/><rect x="20" y="30" width="60" height="40" fill="%23ffffff" opacity="0.2" rx="3"/></svg>');
}

/* ========================================
   Content Overlay & Positioning
   ======================================== */

.hero-content {
    position: relative;
    z-index: 10;
    color: white;
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.6;
    opacity: 0.95;
}

.hero-content .lead {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.9;
}

/* ========================================
   Hero Icon Animations
   ======================================== */

.hero-icon {
    margin-bottom: 2rem;
    animation: heroFloat 4s ease-in-out infinite;
}

.hero-icon i {
    color: rgba(255, 255, 255, 0.8);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(1deg); }
    50% { transform: translateY(-15px) rotate(0deg); }
    75% { transform: translateY(-8px) rotate(-1deg); }
}

/* ========================================
   Button Styles
   ======================================== */

.hero-action {
    margin-top: 2.5rem;
}

.hero-action .btn {
    border-radius: 50px;
    padding: 15px 35px;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid transparent;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.hero-action .btn::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;
}

.hero-action .btn:hover::before {
    left: 100%;
}

.hero-action .btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.hero-action .btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* Primary button */
.hero-action .btn-light {
    background: rgba(255, 255, 255, 0.95);
    color: #198754;
    border-color: rgba(255, 255, 255, 0.3);
}

.hero-action .btn-light:hover {
    background: #ffffff;
    color: #198754;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Outline button */
.hero-action .btn-outline-light {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
}

.hero-action .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
}

/* ========================================
   Feature List Animations
   ======================================== */

.features-list .feature-item {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateX(-30px);
    animation: slideInFromLeft 0.8s ease-out forwards;
}

.features-list .feature-item:nth-child(1) { animation-delay: 0.3s; }
.features-list .feature-item:nth-child(2) { animation-delay: 0.5s; }
.features-list .feature-item:nth-child(3) { animation-delay: 0.7s; }

.features-list .feature-item i {
    margin-right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 8px;
    font-size: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes slideInFromLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   Info Cards (Slide 3)
   ======================================== */

.info-card {
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out forwards;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.info-card:nth-child(1) { animation-delay: 0.2s; }
.info-card:nth-child(2) { animation-delay: 0.4s; }
.info-card:nth-child(3) { animation-delay: 0.6s; }

.info-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.info-card .info-icon {
    margin-bottom: 1.5rem;
}

.info-card .info-icon i {
    font-size: 3rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.info-card h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.info-card p {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.5;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Demo QR Section
   ======================================== */

.demo-qr-card {
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.demo-qr-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.demo-qr-card h5 {
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: white;
}

.qr-demo {
    background: white;
    border-radius: 15px;
    padding: 1rem;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.demo-qr-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.demo-qr-card .btn {
    border-radius: 25px;
    font-weight: 500;
    padding: 10px 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.demo-qr-card .btn-light {
    background: white;
    color: #198754;
    border: none;
}

.demo-qr-card .btn-light:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.demo-qr-card .btn-outline-light {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.demo-qr-card .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

/* ========================================
   Carousel Controls
   ======================================== */

.hero-section .carousel-indicators {
    bottom: 30px;
    z-index: 15;
    margin-bottom: 0;
}

.hero-section .carousel-indicators button {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin: 0 8px;
    background-color: rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.6);
    transition: all 0.4s ease;
    opacity: 0.7;
}

.hero-section .carousel-indicators button.active {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 1);
    transform: scale(1.3);
    opacity: 1;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.hero-section .carousel-indicators button:hover {
    background-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.1);
    opacity: 0.9;
}

/* Navigation arrows */
.hero-section .carousel-control-prev,
.hero-section .carousel-control-next {
    width: 70px;
    height: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
    opacity: 0.8;
}

.hero-section .carousel-control-prev {
    left: 40px;
}

.hero-section .carousel-control-next {
    right: 40px;
}

.hero-section .carousel-control-prev:hover,
.hero-section .carousel-control-next:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
    opacity: 1;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.hero-section .carousel-control-prev-icon,
.hero-section .carousel-control-next-icon {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* ========================================
   Content Animations
   ======================================== */

.hero-content {
    animation: contentFadeIn 1.2s ease-out forwards;
}

@keyframes contentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Text reveal animation */
.hero-content h1 {
    opacity: 0;
    animation: textSlideUp 1s ease-out 0.3s forwards;
}

.hero-content p {
    opacity: 0;
    animation: textSlideUp 1s ease-out 0.6s forwards;
}

.hero-action {
    opacity: 0;
    animation: textSlideUp 1s ease-out 0.9s forwards;
}

@keyframes textSlideUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1200px) {
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .hero-action .btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 992px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .hero-section .carousel-control-prev,
    .hero-section .carousel-control-next {
        width: 60px;
        height: 60px;
    }
    
    .hero-section .carousel-control-prev {
        left: 20px;
    }
    
    .hero-section .carousel-control-next {
        right: 20px;
    }
}

@media (max-width: 768px) {
    .hero-slide {
        background-attachment: scroll;
        padding: 0 20px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-content p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-action .btn {
        padding: 10px 25px;
        font-size: 0.9rem;
        letter-spacing: 0.5px;
        margin: 0.5rem;
        width: auto;
        min-width: 140px;
    }
    
    /* Hide navigation arrows on mobile */
    .hero-section .carousel-control-prev,
    .hero-section .carousel-control-next {
        display: none;
    }
    
    /* Adjust indicators */
    .hero-section .carousel-indicators {
        bottom: 20px;
    }
    
    .hero-section .carousel-indicators button {
        width: 12px;
        height: 12px;
        margin: 0 6px;
    }
    
    /* Info cards mobile */
    .info-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .info-card .info-icon i {
        font-size: 2rem;
    }
    
    .info-card h5 {
        font-size: 1.1rem;
    }
    
    .info-card p {
        font-size: 0.9rem;
    }
    
    /* Demo QR card mobile */
    .demo-qr-card {
        padding: 1.5rem;
    }
    
    .features-list .feature-item {
        font-size: 1rem;
    }
    
    .features-list .feature-item i {
        width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .hero-content p {
        font-size: 0.95rem;
    }
    
    .hero-action .btn {
        display: block;
        width: 100%;
        max-width: 280px;
        margin: 0.5rem auto;
    }
    
    .info-card {
        padding: 1rem;
    }
    
    .demo-qr-card {
        padding: 1rem;
    }
}

/* ========================================
   Dark Mode Support
   ======================================== */

@media (prefers-color-scheme: dark) {
    .hero-slide.slide-1 {
        background-image: 
            linear-gradient(135deg, rgba(25, 135, 84, 0.9), rgba(32, 201, 151, 0.8)),
            url('../images/hero-slide-1.jpg');
    }
    
    .hero-slide.slide-2 {
        background-image: 
            linear-gradient(135deg, rgba(13, 110, 253, 0.9), rgba(25, 135, 84, 0.8)),
            url('../images/hero-slide-2.jpg');
    }
    
    .hero-slide.slide-3 {
        background-image: 
            linear-gradient(135deg, rgba(111, 66, 193, 0.9), rgba(13, 110, 253, 0.8)),
            url('../images/hero-slide-3.jpg');
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .hero-section {
        display: none;
    }
}

/* ========================================
   Accessibility Improvements
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .hero-icon,
    .hero-content,
    .hero-content h1,
    .hero-content p,
    .hero-action,
    .features-list .feature-item,
    .info-card {
        animation: none;
    }
    
    .hero-action .btn {
        transition: none;
    }
    
    .hero-action .btn:hover {
        transform: none;
    }
}