
/* Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --text-color: #1f2937;
    --dark-gray: #111827;
    --light-gray: #f8fafc;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    color: var(--text-color);
    line-height: 1.6;
}

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

/* Header */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.header-main {
    padding: 1rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-navigation a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

.header-search {
    flex-shrink: 0;
}

.search-form {
    display: flex;
}

.search-form input {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px 0 0 4px;
    border-right: none;
}

.search-form button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* Main Content */
.main-content {
    margin-top: 80px;
    min-height: 60vh;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-description {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}

.btn {
    display: inline-block;
    background: var(--white);
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

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

/* Categories Grid */
.categories-section {
    padding: 4rem 0;
    background: var(--light-gray);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.page-description {
    font-size: 1.1rem;
    color: var(--text-color);
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.8;
}

/* 5x5 Grid Layout */
.categories-grid-5x5,
.calculators-grid-5x5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.category-item,
.calculator-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.category-item:hover,
.calculator-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.category-title,
.calculator-title {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.category-description,
.calculator-description {
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    opacity: 0.8;
    text-align: center;
}

.category-meta {
    margin-bottom: 1rem;
}

.category-count {
    background: var(--light-gray);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.category-link,
.calculator-link {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.category-link:hover,
.calculator-link:hover {
    background: var(--secondary-color);
}

/* Pagination */
.pagination {
    margin-top: 3rem;
    text-align: center;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    margin: 0 0.25rem;
    background: var(--white);
    border: 1px solid #d1d5db;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-numbers.current {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.page-numbers:hover {
    background: var(--light-gray);
    border-color: var(--primary-color);
}

/* Footer */
.site-footer {
    background: var(--dark-gray);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-section p {
    color: #d1d5db;
    line-height: 1.6;
    margin-bottom: 1rem;
}

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--white);
}

.copyright-section {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* No Content States */
.no-categories,
.no-calculators,
.no-results,
.no-content {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: var(--white);
    border-radius: 8px;
    border: 2px dashed #d1d5db;
}

.no-categories p,
.no-calculators p,
.no-results p,
.no-content p {
    color: var(--text-color);
    opacity: 0.7;
}

/* Calculator Single Page */
.calculator-single {
    padding: 2rem 0;
}

.calculator-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.calculator-content h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

.calculator-interface {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--light-gray);
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* Page Content */
.page-content {
    padding: 2rem 0;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.entry-content {
    line-height: 1.8;
}

.entry-content p {
    margin-bottom: 1rem;
}

/* Archive & Search */
.archive-page,
.search-results {
    padding: 2rem 0;
}

.archive-header,
.search-header {
    text-align: center;
    margin-bottom: 3rem;
}

.archive-header h1,
.search-header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* 404 Page */
.error-404 {
    padding: 4rem 0;
    text-align: center;
}

.error-content h1 {
    color: var(--primary-color);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.error-actions {
    margin-bottom: 3rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.search-section {
    margin-top: 2rem;
}

.search-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .categories-grid-5x5,
    .calculators-grid-5x5 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .categories-grid-5x5,
    .calculators-grid-5x5 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-navigation ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-content {
        margin-top: 140px;
    }
    
    .categories-grid-5x5,
    .calculators-grid-5x5 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .categories-section {
        padding: 3rem 0;
    }
}

@media (max-width: 576px) {
    .categories-grid-5x5,
    .calculators-grid-5x5 {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .error-actions .btn {
        width: 100%;
        max-width: 300px;
    }
}