/*
|--------------------------------------------------------------------------
| Custom Stylesheet for KTM Energy Experts Theme
|
| This file contains all custom CSS, animations, and non-Tailwind component styles.
| It is designed to be loaded AFTER the Tailwind configuration is parsed/compiled.
|--------------------------------------------------------------------------
*/

/* * 2. CUSTOM COLOR & FONT VARIABLES
 * These define the custom colors used in the theme, based on the Tailwind config
 * provided in your HTML <script> block.
 */
:root {
    --ktm-orange: #F97316;
    --ktm-dark: #111827;
    --ktm-light: #F3F4F6;
    --ktm-accent: #EA580C;
    --ktm-gold: #D97706;
    --ktm-blue: #1E3A8A; /* Deep Blue for Careers page */
}

/* * 3. CORE ANIMATIONS AND UTILITIES
 */

/* Fade-In-Up Animation for Sections */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Navigation Link Underline Effect (Used in header.php) */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--ktm-orange);
    transition: width 0.3s;
}
.nav-link:hover::after {
    width: 100%;
}

/* Animation for Slow Spin (Used in Residential Solar Infographic) */
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.animate-spin-slow {
    animation: spin-slow 12s linear infinite;
}

/* Scrollbar Hide (Needed for Project filter tabs responsiveness) */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* * 4. GAUGE METER STYLES (Used on Home Page)
 * These styles are complex CSS and need to be in the stylesheet. 
 */
.gauge-container {
    width: 120px;
    height: 60px;
    position: relative;
    overflow: hidden;
}

.gauge-arc {
    width: 100%;
    height: 100%;
    /* Gradient adapted from original HTML, using specific colors */
    background: conic-gradient(from 180deg at 50% 100%, 
        #ef4444 0deg 36deg,     /* Red */
        #f97316 36deg 72deg,    /* Orange */
        #eab308 72deg 108deg,   /* Yellow */
        #84cc16 108deg 144deg,  /* Light Green */
        #22c55e 144deg 180deg   /* Green */
    );
    border-top-left-radius: 120px;
    border-top-right-radius: 120px;
}

.gauge-mask {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 60%;
    background-color: var(--ktm-dark); /* Matches dark bg */
    border-top-left-radius: 120px;
    border-top-right-radius: 120px;
}

.gauge-needle-wrapper {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 100%;
    height: 100%;
    transform-origin: bottom center;
    transform: translateX(-50%);
    z-index: 10;
}

.gauge-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 6px;
    height: 100%;
    background: white;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-90deg); /* Start position */
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation: gauge-swing 3s ease-in-out infinite alternate;
}

.gauge-dot {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: white;
    border: 4px solid var(--ktm-accent);
    border-radius: 50%;
    z-index: 20;
}

@keyframes gauge-swing {
    0% { transform: translateX(-50%) rotate(-70deg); }
    30% { transform: translateX(-50%) rotate(-20deg); }
    70% { transform: translateX(-50%) rotate(45deg); }
    100% { transform: translateX(-50%) rotate(70deg); }
}

/* Play Button Pulse Animation (Used on Home Page) */
@keyframes pulse-ring {
    0% { transform: scale(0.8); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 15px rgba(255, 255, 255, 0); }
    100% { transform: scale(0.8); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.play-btn-pulse {
    animation: pulse-ring 2s infinite;
}

/* * 5. CUSTOM FORM STYLES (Used on Contact Page)
 */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
}
.form-input:focus {
    border-color: var(--ktm-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* * 6. CUSTOM RESPONSIVE ADJUSTMENTS 
 * (Tailwind handles most responsiveness (e.g., lg:, md:, sm:), 
 * but this ensures the layout holds up well on very small screens.)
 */
@media (min-width: 350px) and (max-width: 639px) { 
    /* Adjustments specific to screens smaller than Tailwind's 'sm' breakpoint */
    
    /* Ensure hero headlines are manageable */
    .hero-section h1.font-heading {
        font-size: 2.5rem; /* ~40px */
    }
    
    /* Ensure padding exists on very narrow screens */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}