/* ========================================
   Trainova AI Tools - Professional CSS
   Advanced, Modern, and Optimized Design
   ======================================== */

/* ========== ROOT VARIABLES ========== */
:root {
    --primary: #854fff;
    --primary-dark: #6b3fd4;
    --secondary: #06B6D4;
    --accent: #10B981;
    --dark: #0F172A;
    --gradient-primary: linear-gradient(135deg, #854fff 0%, #06B6D4 100%);
    --gradient-secondary: linear-gradient(135deg, #06B6D4 0%, #10B981 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* ========== GLOBAL STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Screen Reader Only (Accessibility) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ========== TYPOGRAPHY ========== */
.section-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
}

.section-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: #6B7280;
    line-height: 1.6;
}

/* ========== BUTTONS ========== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 600;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(133, 79, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(133, 79, 255, 0.6);
}

.btn-primary-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 3rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 700;
    font-size: 1.125rem;
    border-radius: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(133, 79, 255, 0.5);
}

.btn-primary-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(133, 79, 255, 0.7);
}

.btn-secondary-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 3rem;
    background: white;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.125rem;
    border-radius: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 3px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-secondary-large:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(133, 79, 255, 0.5);
}

/* ========== NAVIGATION ========== */
#navbar {
    transition: all 0.3s ease;
}

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

.nav-link {
    position: relative;
    font-size: 1rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

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

@keyframes gradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

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

.animate-gradient {
    background-size: 200% auto;
    animation: gradient 8s linear infinite;
}

/* ========== STAT CARDS ========== */
.stat-card {
    transition: all 0.3s ease;
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.05);
}

/* ========== RESOURCE CARDS ========== */
.resource-card {
    transition: all 0.3s ease;
    cursor: default;
}

.resource-card:hover {
    transform: translateY(-10px);
}

/* ========== TOOL CARDS ========== */
.tool-card {
    transition: all 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
}

.tool-icon-wrapper {
    position: relative;
    overflow: hidden;
}

.tool-icon-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.tool-card:hover .tool-icon-wrapper::before {
    transform: translateX(100%);
}

/* ========== TOOL FILTERS ========== */
.tool-filter {
    background: white;
    color: #6B7280;
    border: 2px solid #E5E7EB;
}

.tool-filter:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(133, 79, 255, 0.05);
}

.tool-filter.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ========== FAQ ACCORDION ========== */
.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(133, 79, 255, 0.1);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding-bottom: 1.5rem;
}

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

/* ========== SCROLL TO TOP BUTTON ========== */
#scroll-top {
    transition: all 0.3s ease;
}

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

/* ========== LOADING STATES ========== */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-center;
}

/* ========== FORM STYLES ========== */
input:focus,
textarea:focus,
select:focus {
    outline: none;
}

input[type="text"],
input[type="email"],
textarea {
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    transform: translateY(-2px);
}

/* ========== SUCCESS/ERROR MESSAGES ========== */
.success-message {
    background: #10B981;
    color: white;
    border-left: 4px solid #059669;
}

.error-message {
    background: #EF4444;
    color: white;
    border-left: 4px solid #DC2626;
}

.info-message {
    background: #3B82F6;
    color: white;
    border-left: 4px solid #2563EB;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1024px) {
    .section-title {
        font-size: 2.5rem;
    }
    
    .section-subtitle {
        font-size: 1.125rem;
    }
}

@media (max-width: 768px) {
    .btn-primary-large,
    .btn-secondary-large {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    .stat-card {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    .no-print,
    nav,
    footer,
    #scroll-top,
    #tv-btn,
    #tv-box {
        display: none !important;
    }
}

/* ========== ACCESSIBILITY ENHANCEMENTS ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========== DARK MODE SUPPORT ========== */
@media (prefers-color-scheme: dark) {
    /* Optional: Add dark mode styles if needed */
}

/* ========== CUSTOM SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ========== SELECTION STYLES ========== */
::selection {
    background: var(--primary);
    color: white;
}

::-moz-selection {
    background: var(--primary);
    color: white;
}

/* ========== FOCUS STYLES (Accessibility) ========== */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ========== IMAGE OPTIMIZATION ========== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========== SMOOTH TRANSITIONS ========== */
a,
button,
input,
textarea,
select {
    transition: all 0.3s ease;
}

/* ========== UTILITY CLASSES ========== */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-glow {
    box-shadow: 0 0 30px rgba(133, 79, 255, 0.3);
}

.border-gradient {
    border: 2px solid transparent;
    background-image: linear-gradient(white, white), var(--gradient-primary);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

/* ========== BACKDROP BLUR SUPPORT ========== */
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
    .backdrop-blur {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

/* ========== PERFORMANCE OPTIMIZATIONS ========== */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* ========== GRID PATTERNS ========== */
.bg-grid-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23854fff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ========== END OF CSS ========== */