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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #2ecc71;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 8px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    font-size: 16px;
}

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

/* Header Styles */
header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
}

.main-nav {
    display: flex;
    gap: 25px;
}

.main-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    font-size: 15px;
}

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.hero h2 {
    font-size: 36px;
    margin-bottom: 15px;
    font-weight: 700;
}

.tagline {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.95;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.search-box input {
    flex: 1;
    padding: 15px 25px;
    border: none;
    font-size: 16px;
    outline: none;
}

.search-box button {
    background: var(--secondary-color);
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition);
}

.search-box button:hover {
    background: #2980b9;
}

/* Calculator Category Sections */
.calculator-category {
    padding: 60px 0;
    border-bottom: 1px solid var(--border-color);
}

.calculator-category:nth-child(even) {
    background-color: var(--bg-light);
}

.calculator-category h2 {
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

.category-icon {
    font-size: 36px;
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.calculator-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary-color);
}

.calculator-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 600;
}

.calculator-card p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
}

/* About Section */
.about-section {
    padding: 60px 0;
    background-color: var(--bg-light);
}

.about-section h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.about-section p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 15px;
    color: var(--text-color);
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-section p {
    font-size: 14px;
    opacity: 0.9;
}

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

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.9;
    transition: var(--transition);
    font-size: 14px;
}

.footer-section ul li a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .hero h2 {
        font-size: 28px;
    }

    .tagline {
        font-size: 16px;
    }

    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .calculator-category h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 40px 0;
    }

    .hero h2 {
        font-size: 24px;
    }

    .search-box {
        flex-direction: column;
        border-radius: 8px;
    }

    .search-box button {
        padding: 12px;
    }
}

/* Calculator Page Styles */
.calculator-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.calculator-page h1 {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.calculator-container {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btn {
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background: #2980b9;
}

.btn-secondary {
    background: var(--text-light);
    margin-left: 10px;
}

.btn-secondary:hover {
    background: #555;
}

.result-box {
    background: var(--bg-light);
    border-left: 4px solid var(--accent-color);
    padding: 20px;
    border-radius: 4px;
    margin-top: 20px;
}

.result-box h3 {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.result-label {
    font-weight: 600;
    color: var(--text-color);
}

.result-value {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 18px;
}

.info-section {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.info-section h2 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.info-section h3 {
    font-size: 20px;
    color: var(--primary-color);
    margin-top: 20px;
    margin-bottom: 10px;
}

.info-section p {
    line-height: 1.8;
    margin-bottom: 15px;
}

.info-section ul, .info-section ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.info-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Breadcrumb */
.breadcrumb {
    padding: 20px 0;
    font-size: 14px;
}

.breadcrumb a {
    color: var(--secondary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 8px;
    color: var(--text-light);
}

/* Performance Optimizations */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-loaded {
    opacity: 1;
}

/* Print Styles */
@media print {
    header, footer, .search-box, .main-nav {
        display: none;
    }

    .calculator-card {
        break-inside: avoid;
    }
}
