/* Custom CSS for Sense-It-Smart Reskilling Website */

/* Performance Optimizations */
* {
    box-sizing: border-box;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* GPU Acceleration for Better Performance */
.transform-gpu {
    transform: translateZ(0);
    will-change: transform;
}

/* Preload Critical Resources */
.preload {
    content-visibility: auto;
    contain-intrinsic-size: 1000px;
}

/* Custom Font */
body {
    font-family: 'Noto Sans JP', sans-serif;
}

/* Hero Section Background - Controlled by HTML */
#home {
    /* Background controlled by HTML img element for better control */
}

/* Ensure hero image is always visible */
#home img {
    opacity: 1 !important;
    transition: none !important;
    visibility: visible !important;
    display: block !important;
    transform: none !important;
}

/* Hero Section Performance Optimization */
#home {
    will-change: transform;
}

/* Enable selective animations in hero section */
#home .animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
}

#home .group:hover svg {
    transition: transform 0.3s ease !important;
}

#home .group:hover .group-hover\:rotate-12 {
    transform: rotate(12deg) !important;
}

#home .group:hover .group-hover\:animate-bounce {
    animation: bounce 1s infinite !important;
}

/* CTA Button animations */
#home a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#home a:hover {
    transform: scale(1.05) !important;
}

/* Floating elements animations */
#home .animate-bounce {
    animation: bounce 1s infinite !important;
}

/* Background gradient animation */
#home .bg-gradient-to-r span:last-child {
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Hero visibility optimization */
#home:not(.hero-visible) .animate-pulse,
#home:not(.hero-visible) .animate-bounce {
    animation-play-state: paused !important;
}

#home.hero-visible .animate-pulse,
#home.hero-visible .animate-bounce {
    animation-play-state: running !important;
}

/* Image fade-in optimization - DISABLED to prevent image switching */
#home img {
    transition: none !important;
}

/* Hardware acceleration for key elements */
#home a,
#home .bg-gradient-to-r,
#home .animate-pulse,
#home .animate-bounce {
    will-change: transform;
    transform: translateZ(0);
}

/* Gradient Text Effects */
.gradient-text {
    background: linear-gradient(135deg, #1e40af, #3b82f6, #06d6a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Custom Button Styles */
.btn-gradient {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #06d6a0, #10b981);
    transition: left 0.3s ease;
}

.btn-gradient:hover::before {
    left: 0;
}

.btn-gradient span {
    position: relative;
    z-index: 1;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

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

/* Program Card Enhancements */
.program-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.program-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.program-card:hover::before {
    opacity: 1;
}

.program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* Section Backgrounds */
.section-bg-pattern {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(30, 64, 175, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(6, 214, 160, 0.05) 0%, transparent 50%);
}

/* Loading Animation */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Form Enhancements */
.form-floating {
    position: relative;
}

.form-floating input,
.form-floating textarea,
.form-floating select {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.form-floating label {
    position: absolute;
    top: 0;
    left: 0;
    padding: 1rem 1rem 0;
    pointer-events: none;
    transform-origin: 0 0;
    transition: all 0.2s ease;
    color: #6b7280;
}

.form-floating input:focus ~ label,
.form-floating textarea:focus ~ label,
.form-floating select:focus ~ label,
.form-floating input:not(:placeholder-shown) ~ label,
.form-floating textarea:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: #1e40af;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(135deg, #1e40af, #06d6a0);
    z-index: 1000;
    transition: width 0.1s ease;
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
}

/* Navigation Enhancements */
header {
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Logo Display Optimization */
header img {
    flex-shrink: 0 !important;
    display: block;
}

header .container {
    overflow: visible;
}

/* Ensure logo container doesn't compress */
header .flex.justify-between {
    min-height: 4.5rem;
}

/* Logo container specific styling */
header .flex.items-center.flex-shrink-0 {
    flex-shrink: 0 !important;
}

/* Mobile Navigation */
#mobile-menu {
    animation: slideDown 0.3s ease;
}

/* Stats Counter Animation */
.counter {
    font-weight: bold;
    color: #1e40af;
}

/* Testimonial Cards */
.testimonial-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Service Icons */
.service-icon {
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
    transition: all 0.3s ease;
}

.service-icon:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.3);
}

/* Pricing Table Enhancements */
.pricing-card {
    position: relative;
    overflow: hidden;
}

.pricing-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(6, 214, 160, 0.1), transparent 30%);
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pricing-card-content {
    position: relative;
    z-index: 1;
}

/* Footer Enhancements */
footer {
    background: linear-gradient(135deg, #1f2937, #111827);
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(6, 214, 160, 0.1) 0%, transparent 50%);
}

/* Back to Top Button */
#back-to-top {
    transition: all 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Utility Classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.shine-effect:hover::after {
    transform: translateX(100%);
}

/* Hero Section Mobile Optimization */
@media (max-width: 1024px) {
    #home .min-h-\[85vh\] {
        min-height: 80vh !important;
    }
}

/* Media Queries for Enhanced Responsiveness */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.25rem !important;
    }
    
    .section-title {
        font-size: 2rem !important;
    }
    
    .card-hover:hover {
        transform: none;
    }
    
    .program-card:hover {
        transform: none;
    }

    /* Logo adjustments for mobile */
    header img {
        height: 3rem !important; /* h-12 equivalent */
        min-width: 160px !important;
    }

    header .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    header .flex.items-center.flex-shrink-0 {
        margin-left: 0 !important;
    }
    
    /* Hero section mobile optimizations */
    #home .py-10 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Disable hover effects on mobile for better performance */
    #home a:hover {
        transform: none !important;
    }
    
    /* Reduce animation complexity on mobile */
    #home .animate-pulse,
    #home .animate-bounce {
        animation: none !important;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
    }
    
    /* Further mobile optimizations */
    #home .min-h-\[85vh\] {
        min-height: 70vh !important;
    }
    
    #home .gap-8 {
        gap: 1.5rem !important;
    }
}

/* Print Styles */
@media print {
    header, footer, #back-to-top, .btn, button {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .container {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}