/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --purple-color: #8b5cf6;
    --pink-color: #ec4899;
    --indigo-color: #6366f1;
    --teal-color: #14b8a6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    --gradient-warm: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-cool: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.95);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    flex-shrink: 0;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    white-space: nowrap;
}


.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: var(--gradient-primary);
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
    will-change: transform;
}

@keyframes pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Removed search container - keeping space for future use */

/* Stats Section */
.stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    background: rgba(255,255,255,0.15);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s;
}

.stat:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    display: block;
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Filter Section */
.filter-section {
    padding: 2rem 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid transparent;
    padding: 0.85rem 1.75rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.filter-btn:hover {
    background: linear-gradient(145deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(37,99,235,0.3);
    transform: translateY(-1px);
}

/* Tests Grid */
.tests-section {
    padding: 5rem 0;
    background: linear-gradient(180deg, #f8f9fc 0%, #ffffff 100%);
    position: relative;
}

.tests-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(180deg, transparent 0%, rgba(99,102,241,0.02) 100%);
    pointer-events: none;
}

.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* Test Card */
.test-card {
    background: linear-gradient(145deg, var(--bg-primary) 0%, #fafbff 100%);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(99,102,241,0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    background-clip: padding-box;
    contain: layout style paint;
    will-change: transform, box-shadow;
}

.test-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: translateX(-100%);
    transition: transform 0.3s;
}

.test-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(99, 102, 241, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    border-radius: 20px;
}

.test-card:hover {
    box-shadow: 0 20px 40px rgba(99,102,241,0.15);
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-color);
}

.test-card:hover::before {
    transform: translateX(0);
}

.test-card:hover::after {
    opacity: 1;
}

.test-icon {
    width: 90px;
    height: 90px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transition: all 0.3s;
    will-change: transform;
}

.test-icon svg {
    width: 60px;
    height: 60px;
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Font Awesome icon system */
.test-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.test-icon i {
    font-size: 24px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Category-specific icon backgrounds */
.test-icon.military {
    background: linear-gradient(135deg, #ee5a24 0%, #f79f1f 100%);
}

.test-icon.iq {
    background: linear-gradient(135deg, #575fcf 0%, #3c40c6 100%);
}

.test-icon.genius {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
}

.test-icon.sports {
    background: linear-gradient(135deg, #0be881 0%, #00d2d3 100%);
}

.test-icon.job {
    background: linear-gradient(135deg, #3742fa 0%, #546de5 100%);
}

.test-icon.child {
    background: linear-gradient(135deg, #ff9ff3 0%, #feca57 100%);
}

.test-icon.postal {
    background: linear-gradient(135deg, #f368e0 0%, #ff6348 100%);
}

.test-icon.realestate {
    background: linear-gradient(135deg, #48dbfb 0%, #0abde3 100%);
}

.test-icon.colorblind {
    background: linear-gradient(135deg, #ee5a6f 0%, #f368e0 100%);
}

.test-icon:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(3deg); }
}

.test-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

.badge {
    position: absolute;
    top: -15px;
    right: -35px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(16,185,129,0.3);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.test-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex: 1;
    line-height: 1.5;
}

.test-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.feature {
    background: linear-gradient(135deg, #e3f2fd 0%, #e8eaf6 100%);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 500;
    border: 1px solid rgba(37,99,235,0.2);
    transition: all 0.2s;
}

.feature:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37,99,235,0.2);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    width: 100%;
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(37,99,235,0.25);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.35);
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
    display: inline-block;
}

.btn-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.btn-link:hover {
    color: var(--secondary-color);
}

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

/* Trust Section */
.trust-section {
    padding: 5rem 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%);
    position: relative;
    overflow: hidden;
}

.trust-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(99,102,241,0.03) 0%, transparent 50%);
    animation: rotate-slow 30s linear infinite;
}

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

.trust-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.trust-item {
    text-align: center;
    padding: 2.5rem;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fc 100%);
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.trust-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.trust-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 10px 25px rgba(37,99,235,0.2);
    transition: all 0.3s;
}

.trust-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.trust-icon:hover {
    transform: translateY(-5px) rotate(5deg);
    box-shadow: 0 15px 35px rgba(37,99,235,0.3);
}

.trust-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.trust-item p {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.footer-section h4 {
    margin-bottom: 1.25rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.95rem;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .nav {
        display: none;
    }
    
    .stats {
        gap: 1.5rem;
        margin-top: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    .tests-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .test-card {
        padding: 1.5rem;
    }
    
    .test-icon {
        font-size: 3rem;
    }
    
    .badge {
        position: static;
        display: inline-block;
        margin-left: 0.5rem;
    }
    
    .filter-buttons {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
        scrollbar-width: none;
    }
    
    .filter-buttons::-webkit-scrollbar {
        display: none;
    }
    
    .filter-btn {
        white-space: nowrap;
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .test-features {
        gap: 0.4rem;
    }
    
    .feature {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .header .container {
        padding: 1rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-btn {
        width: 100%;
    }
    
    .test-card {
        padding: 1.5rem;
    }
}

/* Animation for filtered items */
.test-card {
    animation: fadeIn 0.3s ease-in-out;
}

.test-card.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 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;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Prevent logo cutoff on medium screens */
@media (max-width: 900px) {
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .logo h1::before {
        width: 30px;
        height: 30px;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .nav a {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    nav.active {
        max-height: 300px;
    }
    
    nav ul {
        flex-direction: column;
        padding: 1rem 0;
    }
    
    nav li {
        margin: 0;
    }
    
    nav a {
        display: block;
        padding: 0.75rem 1.5rem;
    }
}

/* Focus styles */
a:focus,
button:focus,
input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header,
    .search-container,
    .filter-section,
    .footer {
        display: none;
    }
    
    .test-card {
        break-inside: avoid;
    }
}