/* ==========================================================================
   FILE 1: styles.css - Paisa Reality Global Stylesheet
   (100% Text-Based, Icon-Free, Premium Layout)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Reset & Base Elements
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Core Color Palette */
    --primary: #0f766e;
    --primary-dark: #0d5f59;
    --primary-light: #14b8a6;
    
    /* Neutral / Text Colors */
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #ffffff;
    --bg-light: #f8fafc;
    --border: #e2e8f0;
    --footer-bg: #0f172a;
    
    /* Status Colors */
    --error: #dc2626;
    --success: #16a34a;
    
    /* Typography (System Fonts Only) */
    --font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    
    /* Spacing & Effects */
    --transition: all 0.3s ease;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-family);
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --------------------------------------------------------------------------
   2. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em; /* Gives a premium, modern feel */
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

main {
    flex: 1;
    display: block;
}

/* Delay expensive below-the-fold rendering until the user is close to it. */
.features,
.trust-bar,
.blog-preview,
.faq,
.page-content,
.blog-list,
.footer {
    content-visibility: auto;
    contain-intrinsic-size: 1px 700px;
}

/* --------------------------------------------------------------------------
   3. Global Layout & Containers
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 5rem 0;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 2rem; }

.section-intro {
    max-width: 760px;
    margin: 0 auto 2rem;
    text-align: center;
}

/* --------------------------------------------------------------------------
   4. Header & Navigation
   -------------------------------------------------------------------------- */
.header {
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    letter-spacing: -0.03em;
}

.nav-logo span {
    color: var(--primary);
    margin-right: 4px;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.nav-links a {
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

/* Mobile Nav Toggle (Text-based, hidden on desktop) */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-family: var(--font-family);
    transition: var(--transition);
}

.nav-toggle:hover {
    color: var(--primary) !important;
}

/* --------------------------------------------------------------------------
   5. Hero Section
   -------------------------------------------------------------------------- */
.hero {
    background-color: var(--bg-light);
    padding: 6rem 0 4rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.hero p {
    font-size: 1.25rem;
    max-width: 650px;
    margin: 0 auto;
    color: var(--text-light);
}

/* --------------------------------------------------------------------------
   6. Calculator Layout & Form
   -------------------------------------------------------------------------- */
.calculator-section {
    background-color: var(--bg);
}

.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.calculator-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.calculator-card h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-group small {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.4rem;
}

input[type="number"],
input[type="text"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-family);
    color: var(--text);
    background-color: var(--bg);
    transition: var(--transition);
}

/* Native styling for select since icons are banned */
select {
    cursor: pointer;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.btn {
    display: inline-block;
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--bg);
    width: 100%;
    margin-top: 1rem;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   7. Results Table
   -------------------------------------------------------------------------- */
.results-container {
    display: none; /* Handled by JS */
    margin-top: 2.5rem;
    animation: fadeIn 0.6s ease-out forwards;
}

.results-container.visible {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 1rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.results-table th {
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.results-table td:last-child,
.results-table th:last-child {
    text-align: right;
    font-weight: 600;
}

.total-row td {
    color: var(--primary);
    font-size: 1.15rem;
    font-weight: 800;
    border-top: 2px solid var(--primary);
    border-bottom: none;
    padding-top: 1.25rem;
}

.deduction td:last-child {
    color: var(--error);
}

/* --------------------------------------------------------------------------
   8. Info Panel
   -------------------------------------------------------------------------- */
.info-panel {
    background-color: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    height: 100%;
}

.info-panel h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.info-panel ul {
    list-style-position: outside;
    margin-left: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-light);
}

.info-panel li {
    margin-bottom: 0.75rem;
}

.tip-box {
    background-color: #f0fdf4; /* Very light green */
    border-left: 4px solid var(--success);
    padding: 1.25rem;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.tip-box p {
    margin: 0;
    color: var(--text);
    font-size: 0.95rem;
}

.notice-panel {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(15, 118, 110, 0.2);
    border-radius: var(--radius);
    background-color: rgba(20, 184, 166, 0.08);
}

.notice-panel p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--text);
}

/* --------------------------------------------------------------------------
   9. Features Grid (Typography Focused)
   -------------------------------------------------------------------------- */
.features {
    background-color: var(--bg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
}

.feature-card {
    padding: 2.5rem 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg-light);
    transition: var(--transition);
    text-align: left;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.feature-card h3 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.feature-card p {
    margin: 0;
    font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   10. Trust Bar (Text Only)
   -------------------------------------------------------------------------- */
.trust-bar {
    background-color: var(--footer-bg);
    padding: 2rem 0;
}

.trust-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.trust-item {
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   11. FAQ Accordion (Using Text Symbols)
   -------------------------------------------------------------------------- */
.faq {
    background-color: var(--bg);
}

.faq-list {
    max-width: 850px;
    margin: 3rem auto 0;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    background: var(--bg-light);
    border: none;
    padding: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-family);
}

/* Using simple text characters instead of icons */
.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-item.open .faq-question::after {
    content: '−';
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-in-out;
    background: var(--bg);
}

.faq-answer p {
    padding: 1.5rem;
    margin: 0;
    color: var(--text-light);
}

.faq-item.open .faq-answer {
    max-height: 600px;
    border-top: 1px solid var(--border);
}

/* Override any encoding issues in the open-state symbol */
.faq-item.open .faq-question::after {
    content: '-';
}

/* --------------------------------------------------------------------------
   12. Blog Preview & Post Styles
   -------------------------------------------------------------------------- */
.blog-preview {
    background-color: var(--bg-light);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
}

.blog-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    content-visibility: auto;
    contain-intrinsic-size: 1px 360px;
}

.blog-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.blog-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.blog-card h2 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.blog-card-media {
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--bg-light);
    overflow: hidden;
}

.blog-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-date,
.blog-list-item .meta,
.blog-post-header .meta {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-light);
}

.blog-card p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.blog-card .read-more {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-hero {
    background: linear-gradient(180deg, #f2fbf9 0%, #ffffff 100%);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.blog-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
}

.blog-list-item {
    display: grid;
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    content-visibility: auto;
    contain-intrinsic-size: 1px 420px;
}

.blog-list-image-link {
    display: block;
    min-height: 100%;
    background: var(--bg-light);
}

.blog-list-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-list-content {
    padding: 1.5rem;
}

.blog-list-content h2 {
    margin-top: 0.6rem;
    margin-bottom: 1rem;
    font-size: 1.6rem;
}

.blog-list-content p {
    margin-bottom: 1.25rem;
}

.blog-empty-state {
    grid-column: 1 / -1;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    background: var(--bg);
    color: var(--text-light);
}

.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 3rem;
}

.blog-pagination-link,
.blog-pagination-current {
    min-width: 44px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    font-weight: 700;
    background: var(--bg);
}

.blog-pagination-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.blog-pagination-current {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.blog-post {
    max-width: 860px;
    padding-top: 4rem;
    padding-bottom: 5rem;
}

.blog-post-header {
    margin-bottom: 2rem;
}

.blog-post-header h1 {
    font-size: 2.8rem;
    line-height: 1.1;
}

.blog-feature-image {
    margin: 0 0 2rem;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.blog-feature-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.blog-post-body {
    color: var(--text);
}

.blog-post-body h2,
.blog-post-body h3,
.blog-post-body h4 {
    margin-top: 2rem;
}

.blog-post-body p,
.blog-post-body li {
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.85;
}

.blog-post-body ul,
.blog-post-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.blog-post-body blockquote {
    margin: 1.75rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--primary);
    background: var(--bg-light);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.blog-post-body img {
    margin: 1.5rem auto;
    border-radius: var(--radius);
}

.blog-post-body a {
    font-weight: 600;
}

.success-banner {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid rgba(22, 163, 74, 0.2);
    background: rgba(22, 163, 74, 0.08);
    color: var(--text);
}

/* Content Pages (About, Guide, etc.) */
.page-hero {
    background-color: var(--primary);
    color: var(--bg);
    padding: 5rem 0;
    text-align: center;
}

.page-hero h1 {
    color: var(--bg);
    margin-bottom: 0;
    font-size: 3rem;
}

.page-content {
    padding: 4rem 0;
    max-width: 800px;
    margin: 0 auto;
}

.page-content p,
.page-content ul,
.page-content ol,
.page-content table,
.page-content .contact-form,
.page-content .tip-box {
    margin-bottom: 1.5rem;
}

.page-content h2 {
    margin-top: 3rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.page-content ul,
.page-content ol {
    padding-left: 1.5rem;
    color: var(--text-light);
}

.page-content li {
    margin-bottom: 0.75rem;
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.guide-table th, .guide-table td {
    border: 1px solid var(--border);
    padding: 1rem;
    text-align: left;
}

.guide-table th {
    background-color: var(--bg-light);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   13. Contact Form Layout
   -------------------------------------------------------------------------- */
.contact-form {
    background: var(--bg-light);
    padding: 3rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.contact-form textarea {
    min-height: 180px;
    resize: vertical;
}

/* --------------------------------------------------------------------------
   14. Footer
   -------------------------------------------------------------------------- */
.footer {
    background-color: var(--footer-bg);
    color: #cbd5e1;
    padding: 5rem 0 2rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-brand .nav-logo {
    display: inline-flex;
    color: var(--bg);
    margin-bottom: 1rem;
}

.footer-brand p {
    color: #94a3b8;
    max-width: 350px;
}

.footer-links h4 {
    color: var(--bg);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 1rem;
}

.footer-links a {
    color: #94a3b8;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
}

/* --------------------------------------------------------------------------
   15. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .blog-list-item {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    .nav-toggle {
        display: block; /* Show text-based menu button */
    }
    
    .nav-links {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--bg);
        flex-direction: column;
        gap: 0;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        transform: translateY(-150%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease-in-out;
    }
    
    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    
    .nav-links a {
        display: block;
        padding: 1.25rem;
        border-top: 1px solid var(--border);
    }
    
    .hero h1 {
        font-size: 2.25rem;
    }
    
    .features-grid, .blog-grid, .form-row {
        grid-template-columns: 1fr;
    }

    .blog-list {
        grid-template-columns: 1fr;
    }

    .blog-post-header h1 {
        font-size: 2.2rem;
    }
    
    .trust-bar .container {
        justify-content: center;
        text-align: center;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }
    
    .footer-brand p {
        margin: 0 auto;
    }
    
    .footer-brand .nav-logo {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .hero {
        padding: 4rem 0 3rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .calculator-card, .info-panel, .contact-form {
        padding: 1.5rem;
    }
    
    .faq-question {
        padding: 1.25rem 1rem;
        font-size: 1rem;
    }
    
    .page-hero h1 {
        font-size: 2.25rem;
    }
    
    .guide-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
