/* Base Styles */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-bg: #0f172a;
    --light-bg: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border-radius-lg: 20px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 15px 40px rgba(0, 0, 0, 0.12);
    --shadow-strong: 0 25px 50px rgba(0, 0, 0, 0.15);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--light-bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    height: 70px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    position: relative;
    padding-left: 45px;
}

.logo::before {
    content: '🚗';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    color: var(--text-secondary);
    -webkit-text-fill-color: var(--text-secondary);
}

.nav {
    display: flex;
    align-items: center;
}

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    background: var(--primary-gradient);
    position: relative;
}

.hamburger {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 2px;
    background: white;
    transition: var(--transition-smooth);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: white;
    left: 0;
    transition: var(--transition-smooth);
}

.hamburger::before {
    top: -6px;
}

.hamburger::after {
    bottom: -6px;
}

.nav-toggle.active .hamburger {
    background: transparent;
}

.nav-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.nav-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-menu li a {
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-md);
    position: relative;
    overflow: hidden;
}

.nav-menu li a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: var(--transition-smooth);
    transform: translateX(-50%);
}

.nav-menu li a:hover {
    color: var(--text-primary);
}

.nav-menu li a:hover::before {
    width: 80%;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 100px 0 60px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: var(--primary-gradient);
    opacity: 0.1;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morphing 20s infinite linear;
}

@keyframes morphing {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; }
    50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
    75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    max-width: 800px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
    line-height: 1.7;
}

.search-box {
    position: relative;
    max-width: 500px;
    margin-top: 2rem;
}

.search-box input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    padding-right: 140px;
    font-size: 1.1rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--border-radius-lg);
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.75rem 1.5rem;
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.search-button:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Top Calculators */
.top-calculators {
    padding: 80px 0;
    background: var(--light-bg);
    position: relative;
}

.top-calculators::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path d="M500,50L0,100H1000Z" fill="%23f8fafc"/></svg>') no-repeat;
    background-size: 100% auto;
    z-index: 0;
}

.top-calculators .container {
    position: relative;
    z-index: 1;
}

.top-calculators h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.top-calculators h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-medium);
}

.card:hover::before {
    transform: scaleX(1);
}

.card img {
    width: 48px;
    height: 36px;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    text-align: center;
    min-width: 140px;
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--secondary-gradient);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.button:hover::before {
    left: 0;
}

.button span {
    position: relative;
    z-index: 1;
}

/* All Countries */
.all-countries {
    padding: 80px 0;
    background: var(--dark-bg);
    position: relative;
    overflow: hidden;
}

.all-countries::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
}

.all-countries h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    color: white;
    position: relative;
}

.all-countries h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.country-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.country-group {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
}

.country-group:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.country-group h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.country-group h3::before {
    content: '📍';
    font-size: 1.25rem;
}

.country-group ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.country-group a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--text-light);
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.country-group a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.3s ease;
}

.country-group a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    padding-left: 1.25rem;
}

.country-group a:hover::before {
    left: 0;
}

.country-group a::after {
    content: '→';
    margin-left: auto;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.country-group a:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* How It Works */
.how-it-works {
    padding: 80px 0;
    background: var(--light-bg);
    position: relative;
}

.how-it-works h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    color: var(--text-primary);
    position: relative;
}

.how-it-works h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.step {
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.step:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-medium);
}

.step:hover::before {
    opacity: 0.02;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    margin: 0 auto 1.5rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.step h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.step p {
    color: var(--text-secondary);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Footer */
.footer {
    background: var(--dark-bg);
    color: white;
    padding: 60px 0 30px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 90%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 90% 10%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
}

.footer .container {
    position: relative;
    z-index: 1;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
    position: relative;
    display: inline-block;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 1.5px;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-col a {
    color: var(--text-light);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-col a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-col a::before {
    content: '→';
    opacity: 0;
    transition: opacity 0.3s ease;
}

.footer-col a:hover::before {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer-bottom p {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 2.8rem;
    }
    
    .top-calculators h2,
    .all-countries h2,
    .how-it-works h2 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .header .container {
        padding: 1rem 1.5rem;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition-smooth);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu li a {
        display: block;
        padding: 1rem;
        text-align: center;
        font-size: 1.1rem;
    }
    
    .hero {
        padding: 80px 0 40px;
        min-height: auto;
    }
    
    .hero h1 {
        font-size: 2.3rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .card-grid,
    .country-list,
    .steps {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .top-calculators,
    .all-countries,
    .how-it-works {
        padding: 60px 0;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1.25rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .search-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .search-box input {
        padding-right: 110px;
        font-size: 1rem;
    }
    
    .card,
    .country-group,
    .step {
        padding: 1.5rem;
    }
    
    .top-calculators h2,
    .all-countries h2,
    .how-it-works h2 {
        font-size: 1.8rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1,
.hero p,
.search-box,
.card,
.step,
.country-group {
    animation: fadeInUp 0.8s ease-out forwards;
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }
.card:nth-child(5) { animation-delay: 0.4s; }

.step:nth-child(2) { animation-delay: 0.1s; }
.step:nth-child(3) { animation-delay: 0.2s; }

/* Selection Color */
::selection {
    background: var(--primary-gradient);
    color: white;
}

::-moz-selection {
    background: var(--primary-gradient);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-gradient);
}