/* ============================================================= */
/* == UNIVERSAL RESET & ROOT VARIABLES                       == */
/* ============================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: Arial, sans-serif;
    background-color: #f9f9f9;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #f779ce;
    --secondary-color: #9b56fc;
    --text-color: #333;
    --bg-light: #f9f9f9;
    --border-color: #ddd;
    --white-color: #ffffff;
    --highlight-bg: linear-gradient(135deg, #e5bef7 0%, #CCCCFF 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --narrow-width: 900px;
    --calculator-width: 800px; /* NEW: For calculator pages with ads */
}

/* ============================================================= */
/* == PAGE LAYOUT & HEADER (FULL WIDTH)                      == */
/* ============================================================= */
.calculator-page {
    width: 100%;
    margin: 0;
    padding: 0;
}

.page-header {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 2rem 1rem;
    text-align: center;
    margin: 0;
    width: 100%;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
}

.intro-text {
    max-width: 800px;
    margin: 1rem auto 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #f0f0f0;
    padding: 0 0.5rem;
}


/* =================================================================== */
/* == NARROW CONTENT LAYOUT - 900px WIDTH (DEFAULT)                 == */
/* This applies to calculator grid/listing pages only                == */
/* =================================================================== */
.calculator-grid,
main,
article,
section,
.content-wrapper,
.main-content {
    max-width: var(--narrow-width) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* =================================================================== */
/* == CALCULATOR PAGE - ALL CONTENT 600px WIDTH FOR ADS            == */
/* =================================================================== */
.calculator-page .calculator-tool,
.calculator-page .calc-result,
.calculator-page .history-box,
.calculator-page .info-section,
.calculator-page .faq-section {
    max-width: var(--calculator-width) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}


/* ============================================================= */
/* == CALCULATOR CARDS GRID                                     == */
/* ============================================================= */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2.5rem;
}

.calculator-card {
    background-color: var(--white-color);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.calculator-card h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.calculator-card p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.calculator-card .use-tool-btn {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.calculator-card .use-tool-btn:hover {
    background-color: #3a7d1e;
}

/* ============================================================= */
/* == CALCULATOR TOOL & OTHER SECTIONS                          == */
/* ============================================================= */
.calculator-tool,
.history-box,
.info-section,
.faq-section {
    background-color: var(--white-color);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    margin-top: 2.5rem;
    margin-bottom: 0;
}

.calculator-tool h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: clamp(1.2rem, 4vw, 1.8rem);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group-full {
    grid-column: 1 / -1;
    text-align: center;
    color: #555;
    font-weight: bold;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 1rem 0;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    width: 100%;
}

.form-group input::placeholder {
    color: #999;
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
}


/* ============================================================= */
/* == BUTTONS & RESULTS                                         == */
/* ============================================================= */
.button-container {
    text-align: center;
    margin-top: 2rem;
}

.calculate-btn {
    background-color: #f779ce !important;
    color: var(--white-color);
    border: none;
    padding: 0.8rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    width: 100%;
    max-width: 200px;
}

.calculate-btn:hover {
    background-color: #CCCCFF !important;
    transform: translateY(-2px);
}

.calc-result {
    margin-top: 2.5rem;
    padding: 2rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
}

.calc-result h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    margin-top: 0;
    font-size: 1.3rem;
}

.result-item {
    margin: 1.5rem 0;
    font-size: 1.1rem;
    padding: 1rem;
    background-color: white;
    border-radius: 6px;
    border-left: 4px solid var(--secondary-color);
}

.result-item strong {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.copy-result-btn {
    background-color: #f779ce;
    color: var(--white-color);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background-color 0.3s;
    width: 100%;
    max-width: 200px;
}

.copy-result-btn:hover {
    background-color: #CCCCFF;
}


/* ============================================================= */
/* == HIGHLIGHT BOX (REMAINS FULL WIDTH)                        */
/* ============================================================= */
.highlight-box {
    background: var(--highlight-bg);
    padding: 3rem 1rem;
    border-radius: 0;
    width: 100%;
    margin: 3rem 0 0 0;
}

.highlight-box .highlight-box-inner {
    max-width: var(--narrow-width) !important;
    margin: 0 auto !important;
}

/* Calculator page highlight boxes - Box itself 600px with orange bg */
.calculator-page .highlight-box {
    background: var(--highlight-bg);
    padding: 3rem 1rem;
    border-radius: 12px;
    width: 100%;
    max-width: var(--calculator-width) !important;
    margin: 3rem auto 0 auto !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

.calculator-page .highlight-box h2,
.calculator-page .highlight-box h4,
.calculator-page .highlight-box p,
.calculator-page .highlight-box ul,
.calculator-page .highlight-box ol,
.calculator-page .highlight-box .section-block {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.highlight-box h2 {
    color: #000000;
    text-align: center;
    margin-top: 0;
    margin-bottom: 1rem;
}

.highlight-box p {
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.highlight-box ul,
.highlight-box ol {
    list-style-position: inside;
    padding-left: 0;
    line-height: 1.8;
}

.highlight-box ul li,
.highlight-box ol li {
    margin-bottom: 0.5rem;
}

.highlight-box strong {
    color: #000;
}

.highlight-box h4 {
    color: #000;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.section-block {
    margin-bottom: 2rem;
}


/* ============================================================= */
/* == INFO & FAQ SECTIONS SPECIFIC STYLES                       == */
/* ============================================================= */
.history-box h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.history-box ul {
    list-style-type: none;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
}

.history-box li {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

.info-section h2,
.faq-section h2 {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin-top: 0;
}

.info-section h3,
.faq-section h3 {
    color: var(--secondary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

.info-section p,
.faq-section p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

.info-section ul,
.faq-section ul {
    list-style-position: inside;
    padding-left: 0;
    line-height: 1.8;
}

.info-section ul li,
.faq-section ul li {
    margin-bottom: 0.5rem;
}


/* ============================================================= */
/* == CALCULATOR PAGE SPECIFIC OVERRIDES                        == */
/* ============================================================= */
/* On screens wider than 768px (desktops and tablets) */
@media (min-width: 769px) {
    .calculator-page .form-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
}

/* Center all headings within the calculator page content */
.calculator-page h1,
.calculator-page h2,
.calculator-page h3,
.calculator-page h4 {
    text-align: center;
}

/* Keep FAQ question headings left-aligned */
.calculator-page .faq-section h3 {
    text-align: left !important;
}

/* Ensure calculator tool stays at 600px for ads */
.calculator-page .calculator-tool,
.calculator-page .calc-result,
.calculator-page #result-container {
    max-width: var(--calculator-width) !important;
}

/* ============================================================= */
/* == RESPONSIVE DESIGN - TABLET (768px and below)              */
/* ============================================================= */
@media (max-width: 768px) {
    .calculator-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .calculator-tool,
    .info-section,
    .faq-section,
    .history-box {
        padding: 1.5rem;
        margin-top: 2rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================= */
/* == RESPONSIVE DESIGN - MOBILE (480px and below)              */
/* ============================================================= */
@media (max-width: 480px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .calculator-tool,
    .info-section,
    .faq-section,
    .history-box {
        padding: 1rem;
        margin-top: 2rem;
    }

    .calculate-btn,
    .copy-result-btn {
        max-width: 100%;
        font-size: 1rem;
        padding: 0.75rem;
    }
}


/* ============================================================= */
/* == UTILITY CLASSES & OTHERS                                  == */
/* ============================================================= */
.show {
    display: block !important;
}

.hide {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.page-header h1,
.calculator-tool h2,
.highlight-box h2,
.info-section h2,
.faq-section h2 {
    font-size: clamp(1rem, 5vw, 2.5rem);
}

#root, #app, .wrapper, .container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}