/* ===== CSS Reset & Variables ===== */
:root {
    /* Primary Colors - Inspired by iLovePDF */
    --primary-red: #e53e3e;
    --primary-blue: #3182ce;
    --primary-coral: #ef4444;
    --pure-white: #ffffff;
    --background-gray: #f7fafc;
    --background-light: #f8f9fa;
    --light-gray: #edf2f7;
    
    /* Supporting Colors */
    --success-green: #38a169;
    --warning-orange: #dd6b20;
    --info-blue: #3182ce;
    --purple-accent: #805ad5;
    
    /* Neutral Foundation */
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-dark: #2d3748;
    --text-medium: #4a5568;
    --text-light: #718096;
    --border-light: #e2e8f0;
    --border-medium: #cbd5e0;
    
    /* Functional */
    --error-red: #e53e3e;
    --input-background: #f7fafc;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --border-radius: 8px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--background-gray) 0%, #ffffff 50%, var(--background-gray) 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(229, 62, 62, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(49, 130, 206, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(128, 90, 213, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: 3rem;
    line-height: 1.2;
    font-weight: 700;
}

h2 {
    font-size: 2.25rem;
    line-height: 1.3;
}

h3 {
    font-size: 1.875rem;
    line-height: 1.4;
}

h4 {
    font-size: 1.5rem;
    line-height: 1.4;
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-medium);
}

a {
    color: var(--primary-red);
    text-decoration: none;
    transition: var(--transition-fast);
}

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

/* ===== Buttons ===== */
.btn, button {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
    display: inline-block;
    font-size: 1rem;
}

.btn-primary, .calculate-btn {
    background: var(--primary-coral);
    color: white;
    border: 2px solid var(--primary-coral);
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    margin-top: var(--spacing-lg);
}

.btn-primary:hover, .calculate-btn:hover {
    background: #dc2626;
    border-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border-light);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    border-color: var(--primary-coral);
    color: var(--primary-coral);
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 0.95rem;
}

input, select, textarea {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    font-family: var(--font-primary);
    font-size: 1rem;
    background: white;
    transition: all var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-coral);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-unit input {
    padding-right: 60px;
}

.unit-label {
    position: absolute;
    right: var(--spacing-md);
    color: var(--text-secondary);
    font-weight: 500;
    pointer-events: none;
}

.input-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
    font-style: italic;
}

/* ===== Header Styles ===== */
.header {
    background: var(--pure-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition-normal);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) 0;
}

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

.logo h1 a {
    color: inherit;
    text-decoration: none;
}

.navigation ul {
    display: flex;
    list-style: none;
    gap: var(--spacing-xl);
}

.nav-link {
    color: var(--text-medium);
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-red);
    background: rgba(229, 62, 62, 0.05);
}

.nav-link.active {
    color: var(--primary-red);
    background: rgba(229, 62, 62, 0.1);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: var(--spacing-sm);
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    margin: 3px 0;
    transition: var(--transition-fast);
}

/* ===== Modern Footer Styles ===== */
.footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #cbd5e1;
    padding: var(--spacing-2xl) 0 var(--spacing-md);
    margin-top: var(--spacing-2xl);
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(239, 68, 68, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(49, 130, 206, 0.04) 0%, transparent 50%);
    z-index: 1;
}

.footer-minimal {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #cbd5e1;
    padding: var(--spacing-sm) 0 var(--spacing-xs);
    margin-top: var(--spacing-sm);
    position: relative;
    overflow: hidden;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 2;
}

.footer-section {
    position: relative;
}

.footer-section h3 {
    color: #ffffff;
    margin-bottom: var(--spacing-md);
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, var(--primary-red) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary-red);
    border-radius: 1px;
}

.footer-section h4 {
    color: #f1f5f9;
    margin-bottom: var(--spacing-md);
    font-size: 1.05rem;
    font-weight: 600;
    position: relative;
}

.footer-section p {
    color: #94a3b8;
    line-height: 1.6;
    font-size: 0.95rem;
}

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

.footer-section ul li {
    margin-bottom: var(--spacing-sm);
    transition: all var(--transition-fast);
}

.footer-section ul li:hover {
    transform: translateX(2px);
}

.footer-section ul li a {
    color: #94a3b8;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
    display: inline-block;
}

.footer-section ul li a::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background: var(--primary-red);
    transition: width var(--transition-fast);
}

.footer-section ul li a:hover {
    color: #ffffff;
}

.footer-section ul li a:hover::before {
    width: 100%;
}

.footer-bottom {
    text-align: center;
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-sm);
    color: #94a3b8;
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: var(--spacing-lg);
}

.footer-bottom::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-red) 50%, transparent 100%);
    border-radius: 1px;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 400;
}

.social-links {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    transition: var(--transition-fast);
}

.social-link:hover {
    background: var(--primary-red);
    transform: translateY(-2px);
}

/* ===== Calculator Tabs ===== */
.calculator-tabs {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xl);
    background: var(--background-light);
    padding: var(--spacing-xs);
    border-radius: var(--border-radius);
}

.calc-tab {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    background: transparent;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.calc-tab.active {
    background: white;
    color: var(--primary-coral);
    box-shadow: var(--shadow-sm);
}

.calc-tab:hover:not(.active) {
    color: var(--text-primary);
}

/* ===== Mode Sections ===== */
.mode-section {
    display: none;
}

.mode-section.active {
    display: block;
}

/* ===== Trust Indicators ===== */
.trust-indicators {
    display: flex;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.trust-icon {
    width: 20px;
    height: 20px;
    background: var(--success-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.trust-text {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

/* ===== Results Actions ===== */
.result-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-light);
}

/* ===== FAQ Styles ===== */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: var(--spacing-lg);
    background: white;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-fast);
}

.faq-question:hover {
    background: var(--background-light);
}

.faq-icon {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-coral);
}

.faq-answer {
    display: none;
    padding: 0 var(--spacing-lg) var(--spacing-lg);
    background: var(--background-light);
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-answer p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== Reviews Carousel ===== */
.reviews-carousel-container {
    position: relative;
    overflow: hidden;
    margin-top: var(--spacing-xl);
}

.reviews-carousel {
    display: flex;
    gap: var(--spacing-lg);
    animation: scrollReviews 30s linear infinite;
    width: calc(200% + var(--spacing-lg));
}

.reviews-carousel:hover {
    animation-play-state: paused;
}

@keyframes scrollReviews {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-50% - var(--spacing-lg) / 2));
    }
}

.review-card {
    flex: 0 0 300px;
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.reviewer-info {
    display: flex;
    gap: var(--spacing-md);
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-coral);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.reviewer-name {
    font-weight: 600;
    color: var(--text-primary);
}

.review-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.review-rating {
    color: #fbbf24;
}

.star {
    font-size: 1.1rem;
}

.review-content p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-style: italic;
}

.review-helpful {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-light);
}

.helpful-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.helpful-btn {
    background: var(--background-light);
    border: 1px solid var(--border-light);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.helpful-btn:hover {
    background: var(--primary-coral);
    color: white;
    border-color: var(--primary-coral);
}



/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .navigation {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .navigation.active {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: var(--shadow-lg);
        padding: var(--spacing-lg);
    }
    
    .navigation.active ul {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .trust-indicators {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .footer-section h3 {
        font-size: 1.2rem;
    }
    
    .footer-section h4 {
        font-size: 1rem;
    }
    
    .reviews-carousel {
        gap: var(--spacing-md);
    }
    
    .review-card {
        flex: 0 0 280px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .review-card {
        flex: 0 0 250px;
        padding: var(--spacing-lg);
    }
}

/* ===== Index Page Specific Styles ===== */

/* Search Bar Styles */
.hero-search-bar {
    position: relative;
    max-width: 500px;
    margin: 0 auto var(--spacing-xl);
}

.hero-search-bar input {
    width: 100%;
    padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-lg) var(--spacing-xl);
    font-size: 1.1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    background: white;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}

.hero-search-bar input:focus {
    border-color: var(--primary-red);
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.search-button {
    position: absolute;
    right: var(--spacing-sm);
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-red);
    color: white;
    border: none;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-button:hover {
    background: #dc2626;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.suggestion-item {
    padding: var(--spacing-md);
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.suggestion-item:hover, .suggestion-item.highlighted {
    background: var(--background-light);
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Category Tabs Section */
.category-tabs-section {
    background: white;
    padding: var(--spacing-xl) 0;
    border-bottom: 1px solid var(--border-light);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(247, 250, 252, 0.95) 100%);
    backdrop-filter: blur(10px);
    text-align: center;
    padding: var(--spacing-3xl) 0 var(--spacing-2xl);
    position: relative;
    overflow: visible;
    z-index: 2;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(229, 62, 62, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(49, 130, 206, 0.03) 0%, transparent 50%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(247, 250, 252, 0.05) 100%);
    z-index: -1;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(90deg, transparent 79px, rgba(229, 62, 62, 0.02) 81px, transparent 82px),
        linear-gradient(rgba(229, 62, 62, 0.02) 1px, transparent 1px);
    background-size: 80px 80px;
    animation: gridMove 20s linear infinite;
    z-index: -1;
    opacity: 0.3;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    line-height: 1.2;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary-red) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-2xl);
    color: var(--text-medium);
    font-weight: 400;
    line-height: 1.5;
    animation: fadeInUp 1s ease-out 0.2s both;
}

/* Calculator-themed Shapes */
.calculator-shape {
    position: absolute;
    pointer-events: none;
    opacity: 0.08;
    font-family: var(--font-mono);
    color: var(--primary-red);
    animation: float 15s ease-in-out infinite;
}

.math-symbol {
    top: 20%;
    left: 12%;
    font-size: 4rem;
    font-weight: 700;
    animation-delay: 0s;
}

.equals-symbol {
    top: 30%;
    right: 15%;
    font-size: 3.5rem;
    font-weight: 700;
    animation-delay: 2s;
    color: var(--primary-blue);
}

.percent-symbol {
    bottom: 25%;
    left: 8%;
    font-size: 3rem;
    font-weight: 700;
    animation-delay: 4s;
    color: var(--purple-accent);
}

.calculator-icon {
    bottom: 20%;
    right: 12%;
    font-size: 5rem;
    animation-delay: 6s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.calc-screen {
    width: 60px;
    height: 20px;
    background: var(--text-dark);
    border-radius: 2px;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    width: 60px;
}

.calc-btn-mini {
    width: 12px;
    height: 12px;
    background: var(--text-medium);
    border-radius: 2px;
}

/* Additional calculator shapes */
.division-symbol {
    top: 60%;
    left: 15%;
    font-size: 2.5rem;
    animation-delay: 1s;
    color: var(--warning-orange);
}

.multiply-symbol {
    top: 40%;
    left: 80%;
    font-size: 2.5rem;
    animation-delay: 3s;
    color: var(--info-blue);
}

.square-root-symbol {
    bottom: 40%;
    right: 20%;
    font-size: 3rem;
    animation-delay: 5s;
    color: var(--success-green);
}

.pi-symbol {
    top: 70%;
    right: 10%;
    font-size: 2.5rem;
    animation-delay: 7s;
    color: var(--purple-accent);
}

.sigma-symbol {
    bottom: 30%;
    left: 20%;
    font-size: 3rem;
    animation-delay: 9s;
    color: var(--primary-blue);
}

/* Complex calculator shapes */
.clock-shape {
    bottom: 60%;
    right: 30%;
    width: 40px;
    height: 40px;
    border: 3px solid var(--text-medium);
    border-radius: 50%;
    position: relative;
    animation-delay: 8s;
}

.clock-face {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.clock-hands {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hour-hand, .minute-hand {
    position: absolute;
    background: var(--text-dark);
    transform-origin: bottom center;
}

.hour-hand {
    width: 1px;
    height: 8px;
    top: -8px;
    left: -0.5px;
    transform: rotate(45deg);
}

.minute-hand {
    width: 1px;
    height: 12px;
    top: -12px;
    left: -0.5px;
    transform: rotate(90deg);
}

.graph-lines {
    top: 50%;
    left: 5%;
    width: 40px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation-delay: 10s;
}

.line {
    height: 2px;
    background: var(--primary-red);
    border-radius: 1px;
}

.line-1 { width: 20px; }
.line-2 { width: 35px; }
.line-3 { width: 25px; }

.scientific-icon {
    top: 15%;
    right: 25%;
    animation-delay: 11s;
}

.function-text {
    font-family: var(--font-mono);
    font-style: italic;
    font-size: 2rem;
    color: var(--purple-accent);
}

.house-icon {
    bottom: 50%;
    left: 25%;
    width: 30px;
    height: 30px;
    animation-delay: 12s;
}

.house-roof {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 15px solid var(--warning-orange);
}

.house-base {
    width: 24px;
    height: 15px;
    background: var(--text-medium);
    margin: 0 3px;
}

/* Featured Tools Section */
.featured-tools {
    padding: var(--spacing-3xl) 0;
    background: white;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-2xl);
}

.tool-card {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-red);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(229, 62, 62, 0.1), transparent);
    transition: left var(--transition-normal);
}

.tool-card:hover::before {
    left: 100%;
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-lg);
    display: block;
    position: relative;
    z-index: 1;
}

.tool-name {
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
}

.tool-description {
    color: var(--text-medium);
    line-height: 1.6;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Categories Section */
.categories-section {
    padding: var(--spacing-3xl) 0;
    background: var(--background-gray);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-2xl);
    color: var(--text-primary);
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-2xl);
    flex-wrap: wrap;
}

.tab-category {
    padding: var(--spacing-md) var(--spacing-lg);
    background: white;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}

.tab-category:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.tab-category.active {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.tool-card[data-category] {
    display: none;
}

.tool-card[data-category].visible {
    display: block;
}

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

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

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(80px, 80px);
    }
}

/* ===== Related Cards Section ===== */
.related-section {
    background: var(--background-light);
    padding: var(--spacing-3xl) 0 var(--spacing-lg);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-2xl);
}

.related-card {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    text-decoration: none;
    text-align: center;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    display: block;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-red);
}

.related-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.1), transparent);
    transition: left var(--transition-normal);
}

.related-card:hover::before {
    left: 100%;
}

.related-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-lg);
    display: block;
    position: relative;
    z-index: 1;
}

.related-card h3 {
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
    font-size: 1.25rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.related-card p {
    color: var(--text-medium);
    line-height: 1.6;
    margin: 0;
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
}

.related-card:hover h3 {
    color: var(--primary-red);
}

.related-card:hover p {
    color: var(--text-dark);
}

/* ===== Modal Styles ===== */
.calculator-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.modal-close:hover {
    background: var(--background-light);
    color: var(--primary-red);
}

/* Mobile responsive for index page */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .calculator-shape {
        display: none;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: var(--spacing-md);
    }
    
    .category-tabs {
        gap: var(--spacing-xs);
    }
    
    .tab-category {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .related-card {
        padding: var(--spacing-lg);
    }
}
