/* =========================================
   1. GLOBAL RESET & BASE STYLES
   ========================================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #007bff;
    transition: color 0.2s;
}

a:hover {
    color: #0056b3;
}

h1, h2, h3 {
    margin-top: 0;
    color: #333;
}

/* =========================================
   2. NAVIGATION BAR (Shared across all pages)
   ========================================= */
nav {
    background: white;
    padding: 1rem 5%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

/* 1. This styles the container (Layout & Font) */
.nav-brand {
    font-weight: bold;
    font-size: 1.5rem;
    color: #333;
}

/* 2. This styles the link INSIDE the container (Removes the "Link Look") */
.nav-brand a {
    text-decoration: none;  /* Kills the underline */
    color: inherit;         /* Forces the link to use the #333 from above */
    cursor: pointer;
}

.nav-links a {
    margin-left: 20px;
    font-size: 0.95rem;
    color: #555;
    font-weight: 500;
}

.nav-links a:hover {
    color: #007bff;
}

/* =========================================
   3. LAYOUT CONTAINERS
   ========================================= */
/* Main wrapper for Calculator Pages */
.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Wrapper for the Calculator Card itself */
.calculator-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

/* =========================================
   4. HOMEPAGE SPECIFIC STYLES (The Grid)
   ========================================= */
.hero {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    display: block; /* Makes the whole card clickable */
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
    border-color: #007bff;
}

.card h3 {
    color: #007bff;
    margin-bottom: 10px;
}

.card p {
    color: #666;
    margin: 0;
}

/* =========================================
   5. CALCULATOR FORM ELEMENTS
   ========================================= */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="number"], 
input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border 0.2s;
}

input:focus {
    border-color: #007bff;
    outline: none;
}

/* The Green Calculate Button */
button.calc-btn {
    width: 100%;
    padding: 14px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

button.calc-btn:hover {
    background-color: #218838;
}

/* The Result Box */
.result-box {
    margin-top: 25px;
    padding: 20px;
    background-color: #e9f5ff;
    border-radius: 8px;
    border-left: 5px solid #007bff;
    display: none; /* Hidden by default */
}

.result-text {
    font-size: 1.2rem;
    color: #333;
    margin: 0;
}

/* =========================================
   6. ADVERTISING SLOTS (Hidden for now)
   ========================================= */
.ad-slot {
    display: none; /* DELETE THIS LINE TO SHOW ADS */
    
    background-color: #eee;
    border: 1px dashed #ccc;
    color: #777;
    display: flex; /* Keeps flex layout even when hidden via display:none override */
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    font-size: 0.8rem;
}

/* Specific Sizes */
.ad-leaderboard { width: 728px; height: 90px; max-width: 100%; }
.ad-sidebar { width: 160px; height: 600px; }
.ad-rectangle { width: 300px; height: 250px; }

/* Responsive Ads: Hide huge sidebars on mobile */
@media (max-width: 1000px) {
    .sidead { display: none; }
}

/* =========================================
   7. FOOTER & UTILITIES
   ========================================= */
footer {
    text-align: center;
    padding: 40px;
    background: #333;
    color: #ccc;
    margin-top: 60px;
}

footer a {
    color: #fff;
    margin: 0 10px;
    font-size: 0.9rem;
}

/* Back Link for sub-pages */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    font-weight: 600;
}
