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

:root {
    --primary: #e53e3e;
    --primary-dark: #c53030;
    --secondary: #4a5568;
    --success: #38a169;
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --gray-900: #171923;
    --white: #ffffff;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --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);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    text-decoration: none;
}

.nav-logo i {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
    background: var(--gray-100);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-icon-large {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--white);
    font-size: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto;
}

/* Calculator */
.calculator-section {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
}

.calculator {
    max-width: 350px;
    margin: 0 auto;
}

.display {
    margin-bottom: 1rem;
}

.equation-display {
    height: 30px;
    font-size: 0.9rem;
    text-align: right;
    padding: 0.5rem 1rem;
    color: var(--gray-600);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    white-space: nowrap;
}

.display input {
    width: 100%;
    height: 60px;
    font-size: 1.8rem;
    text-align: right;
    padding: 0 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 0 0 8px 8px;
    background: var(--gray-50);
    color: var(--gray-900);
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.btn {
    height: 60px;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn.number {
    background: var(--gray-100);
    color: var(--gray-800);
}

.btn.number:hover {
    background: var(--gray-200);
}

.btn.operator {
    background: var(--primary);
    color: var(--white);
}

.btn.operator:hover {
    background: var(--primary-dark);
}

.btn.clear {
    background: var(--gray-600);
    color: var(--white);
}

.btn.clear:hover {
    background: var(--gray-700);
}

.btn.equals {
    background: var(--success);
    color: var(--white);
    grid-column: span 2;
}

.btn.equals:hover {
    background: #2f855a;
}

.btn.zero {
    grid-column: span 2;
}

/* Features Info */
.features-info {
    margin-top: 4rem;
}

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

.feature-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.feature-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Related Tools Section */
.related-tools-section {
    text-align: center;
    margin: 4rem 0;
}

.related-tools-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.related-tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    text-decoration: none;
    color: var(--gray-700);
    transition: all 0.2s;
    font-size: 0.9rem;
}

.related-tool:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

.related-tool i {
    font-size: 1.5rem;
}

/* SEO Content */
.seo-content {
    margin-top: 4rem;
    background: var(--white);
    border-radius: 12px;
    padding: 3rem 2rem;
    box-shadow: var(--shadow);
}

.seo-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.seo-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 2rem 0 1rem;
}

.seo-section p {
    color: var(--gray-700);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* Footer */
.footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 2rem 0;
    text-align: center;
    color: var(--gray-600);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .calculator {
        max-width: 100%;
    }
    
    .btn {
        height: 50px;
        font-size: 1rem;
    }
    
    .display input {
        height: 60px;
        font-size: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}