/* ==================== Variables ==================== */
:root {
    --primary-color: #8B4513;
    --primary-dark: #6B3410;
    --primary-light: #A0522D;
    --secondary-color: #D2691E;
    --accent-color: #F4A460;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --text-dark: #2C3E50;
    --text-muted: #6C757D;
    --light-bg: #F8F9FA;
    --border-color: #DEE2E6;
    --white: #FFFFFF;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --border-radius: 8px;
}

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

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

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

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

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 28px;
}

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

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

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

/* ==================== Hero Search Section ==================== */
.hero-search {
    background: linear-gradient(135deg, #8B4513 0%, #6B3410 100%);
    color: var(--white);
    padding: 60px 0;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 20px;
    text-align: center;
    opacity: 0.95;
    margin-bottom: 40px;
}

.search-box {
    max-width: 700px;
    margin: 0 auto 40px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 18px 20px 18px 55px;
    font-size: 16px;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.search-box input:focus {
    outline: 3px solid var(--accent-color);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--light-bg);
}

.search-result-item h4 {
    color: var(--text-dark);
    font-size: 16px;
    margin-bottom: 4px;
}

.search-result-item p {
    color: var(--text-muted);
    font-size: 14px;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.stat-item i {
    font-size: 24px;
}

.stat-item span {
    font-size: 15px;
}

/* ==================== Categories Quick Nav ==================== */
.categories-quick-nav {
    padding: 40px 0;
    background: var(--white);
}

.category-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
}

.category-tab:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.category-tab i {
    font-size: 32px;
    color: var(--primary-color);
}

.category-tab h3 {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.category-tab span {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==================== Popular Tools ==================== */
.popular-tools {
    padding: 60px 0;
    background: var(--light-bg);
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 32px;
    color: var(--text-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.section-header h2 i {
    color: var(--primary-color);
}

.section-header p {
    font-size: 18px;
    color: var(--text-muted);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.tool-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.tool-card.featured {
    border: 2px solid var(--primary-color);
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary-color);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.card-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.card-icon i {
    font-size: 24px;
    color: var(--white);
}

.tool-card h3 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.tool-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-badge {
    background: var(--light-bg);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* ==================== All Calculators ==================== */
.all-calculators {
    padding: 60px 0;
    background: var(--white);
}

.calculator-category {
    margin-bottom: 50px;
    padding: 30px;
    background: var(--light-bg);
    border-radius: var(--border-radius);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.category-icon-large {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-icon-large i {
    font-size: 28px;
    color: var(--white);
}

.category-header h3 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.category-header p {
    color: var(--text-muted);
    font-size: 15px;
}

.view-all-link {
    margin-left: auto;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.view-all-link:hover {
    color: var(--primary-dark);
}

.calculator-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.calc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.calc-item:hover {
    border-color: var(--primary-color);
    background: var(--light-bg);
    transform: translateX(4px);
}

.calc-item i {
    font-size: 18px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.calc-item span {
    color: var(--text-dark);
    font-size: 15px;
}

/* ==================== Footer ==================== */
.site-footer {
    background: #2C3E50;
    color: var(--white);
    padding: 50px 0 20px;
}

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

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--accent-color);
}

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

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

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--white);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-tabs {
        grid-template-columns: 1fr;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-list {
        grid-template-columns: 1fr;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .view-all-link {
        margin-left: 0;
        align-self: flex-start;
    }
    
    .main-nav {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .hero-search {
        padding: 40px 0;
    }
    
    .section-header h2 {
        font-size: 24px;
    }
}

/* ==================== About Tools Section ==================== */
.about-tools {
    padding: 40px 0;
    background: #fafafa;
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-content h2 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.about-content p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 16px;
    text-align: left;
}

.about-content p strong {
    color: var(--primary-color);
    font-weight: 600;
}

@media (max-width: 768px) {
    .about-tools {
        padding: 30px 0;
    }
    
    .about-content h2 {
        font-size: 24px;
    }
    
    .about-content p {
        font-size: 15px;
    }
}
