/* Base Styles */
:root {
    --primary-color: #4a6bff;
    --secondary-color: #3a56d4;
    --accent-color: #ff6b6b;
    --dark-color: #1a202c;
    --text-color: #2d3748;
    --light-text: #718096;
    --lighter-text: #a0aec0;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.2;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 2.75rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.35rem;
    margin-bottom: 2rem;
    font-weight: 500;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Features Section */
.intro-section {
    padding: 4rem 0;
    text-align: center;
}

.intro-section h2 {
    font-size: 2.25rem;
    margin-bottom: 3rem;
    color: var(--dark-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--light-text);
    font-size: 1rem;
}

/* Popular Tools */
.popular-tools {
    padding: 3rem 0;
}

.popular-tools h2 {
    font-size: 2.25rem;
    margin-bottom: 2rem;
    text-align: center;
}

.popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.popular-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.popular-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.popular-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.popular-card p {
    color: var(--light-text);
    font-size: 0.95rem;
}

/* Calculator Categories */
.calculator-categories {
    padding: 3rem 0;
}

.category-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
    position: relative;
}

.category-description {
    color: var(--light-text);
    margin-bottom: 1.5rem;
    max-width: 800px;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0 3rem;
}

/* Calculator Cards */
.calc-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    border-top: 3px solid var(--primary-color);
}

.calc-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.calc-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.calc-card p {
    color: var(--light-text);
    font-size: 0.95rem;
}

/* Content Section */
.content-section {
    padding: 3rem 0;
    line-height: 1.7;
}

.content-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.content-section h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

.content-section p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.content-section a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.content-section a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 4rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-section h4 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.75rem;
}

.footer-section a {
    color: #cbd5e0;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #4a5568;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-bottom p {
    color: #a0aec0;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-links a {
    color: white;
    font-size: 1.25rem;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.25rem;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Education/Math Category Styles */
.calculator-category {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid #e2e8f0;
}

.category-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.category-title {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.category-title i {
    color: #4a6bff;
}

.category-description {
    color: #718096;
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.6;
}

.calculator-subgroup {
    margin-bottom: 3rem;
}

.subgroup-title {
    font-size: 1.5rem;
    color: #4a5568;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #edf2f7;
}

.subgroup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.calc-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-top: 3px solid #4a6bff;
    position: relative;
    overflow: hidden;
}

.calc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.card-icon {
    font-size: 1.75rem;
    color: #4a6bff;
    margin-bottom: 1rem;
}

.calc-card h4 {
    font-size: 1.25rem;
    color: #2d3748;
    margin-bottom: 0.75rem;
}

.calc-card p {
    color: #718096;
    font-size: 0.95rem;
    line-height: 1.5;
}

.card-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #4a6bff;
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-bottom-left-radius: 8px;
}

.category-footer {
    text-align: center;
    margin-top: 2rem;
}

.category-note {
    color: #718096;
    font-size: 0.95rem;
}

.category-note a {
    color: #4a6bff;
    font-weight: 500;
    text-decoration: none;
}

.category-note a:hover {
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .category-title {
        font-size: 1.75rem;
    }
    
    .subgroup-grid {
        grid-template-columns: 1fr;
    }
}