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

html, body {
    overflow-x: hidden; /* 🛑 Prevent horizontal scroll */
}



/* BODY */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    color: #333;
    display: flex;
    flex-direction: column;
}

/* MAIN CONTAINER */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 20px auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    box-sizing: border-box;
    flex: 1;
}

/* HEADER */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.1em;
    opacity: .9;
}

/* MAIN SECTION */
.main-section {
    margin-bottom: 80px;
}

/* SEARCH */
.search-container {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.search-box {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 50px;
    outline: none;
    transition: .3s;
}

.search-box:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.1);
}

/* CATEGORY FILTER */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.category-button {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #ddd;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
    font-family: inherit;
}

.category-button:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.category-button.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* STATS */
.stats {
    text-align: center;
    padding: 15px;
    color: #666;
    font-size: 0.9em;
    background: #f8f9fa;
}

/* NO RESULTS */
.no-results {
    display: none;
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.2em;
}

.no-results.show {
    display: block;
}

/* GRID */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* 📱 Responsive fix */
    gap: 20px;
    padding: 30px;
}

/* CARDS */
.calculator-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: .3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102,126,234,0.2);
    border-color: #667eea;
}

.calculator-card h3 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 1.2em;
}

.category {
    display: inline-block;
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .85em;
    margin-bottom: 10px;
    color: #666;
}

.description {
    font-size: .9em;
    color: #666;
}

/* FORM */
.calculator-form-container {
    display: none;
    padding: 40px;
    background: #f8f9fa;
    min-height: 400px;
}

.calculator-form-container.active {
    display: block;
}

.calculator-form {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    margin: auto;
}

/* BUTTON */
.submit-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 100%;
    padding: 15px 40px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    color: white;
    font-weight: 600;
    transition: .3s;
}

.submit-button:hover {
    transform: translateY(-2px);
}

/* NAVIGATION */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(255,255,255,0.1);

    flex-wrap: wrap; /* 📌 Important Fix */
}

.nav-brand h1 {
    font-size: 2em;
    color: white;
}

.nav-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* 📱 Fix overflow */
}

.nav-link {
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 25px;
    opacity: .8;
    color: white;
    text-decoration: none;
    transition: .3s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.2);
    opacity: 1;
}

/* FOOTER */
.main-footer {
    background: #1a1a2e;
    color: white;
    margin-top: 60px;
}

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

.footer-bottom {
    padding: 15px;
    background: #0f0f1e;
    text-align: center;
}

/* 🔥 MOBILE FIXES */
@media (max-width: 768px) {

    header h1 {
        font-size: 2em;
    }

    .hero-section h2 {
        font-size: 1.7em;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    .calculator-form {
        padding: 20px;
    }

    .footer-content {
        text-align: center;
    }
}


/* FOOTER - Professional & Centered */
.main-footer {
    width: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 0;
    color: #fff;
    margin-top: auto;
    box-sizing: border-box;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 50px 40px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: left;
}

.footer-section {
    padding: 0 10px;
}

.footer-section h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: 600;
}

.footer-section p {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-links,
.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li,
.footer-links-list li {
    margin-bottom: 12px;
}

.footer-links a,
.footer-links-list a {
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

.footer-links a:hover,
.footer-links-list a:hover {
    color: #667eea;
    transform: translateX(5px);
}

.social-links {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-link {
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.social-link:hover {
    color: #667eea;
    transform: translateX(5px);
}

.footer-bottom {
    padding: 25px 20px;
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-bottom p {
    margin: 5px 0;
    color: #ccc;
}

.footer-bottom a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-bottom a:hover {
    color: #667eea;
    text-decoration: underline;
}

/* Container spacing */
.container {
    margin-bottom: 0;
}

/* Mobile Responsive Footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 30px 20px;
        gap: 40px;
    }
    
    .footer-section {
        padding: 0;
    }
    
    .social-links {
        align-items: center;
        justify-content: center;
    }
    
    .footer-links a:hover,
    .social-link:hover {
        transform: translateX(0);
    }
}
