/* ========================================
   FARAIDH CALCULATOR STYLESHEET
   MUHAZU Global - All-in-One Version
   ======================================== */

/* ========================
   CSS VARIABLES & ROOT
   ======================== */
   :root {
    /* Color Scheme */
    --bg: #ffffff;
    --text: #111111;
    --muted: #6b7280;
    --brand: #d4af37; /* MUHAZU Gold */
    --brand-600: #b9922d;
    --brand-200: #f3e7c8;
    --card: #faf7ef;
    --stroke: #ece7d6;
    --shadow: 0 10px 30px rgba(0, 0, 0, .08);
    --radius: 18px;

/* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
}

/* ========================
   BASE STYLES & RESET
   ======================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ========================
   NAVIGATION BAR
   ======================== */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid #eee;
}

.nav .wrap {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.brand img {
    height: 34px;
    width: 34px;
    border-radius: 8px;
}

.brand span {
    font-weight: 700;
    letter-spacing: 0.4px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

.links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.links a {
    padding: 8px 12px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: all 0.3s ease;
}

.links a:hover {
    background: var(--card);
}

.cta {
    padding: 10px 14px !important;
    border-radius: 999px;
    background: var(--brand) !important;
    color: #111 !important;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.cta:hover {
    background: var(--brand-600) !important;
    transform: translateY(-2px);
}

/* ========================
   HERO SECTION
   ======================== */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(180deg, #fff, #fff 65%, #f9f5ea);
}

.pattern-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(212, 175, 55, 0.15) 35px, rgba(212, 175, 55, 0.15) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(212, 175, 55, 0.15) 35px, rgba(212, 175, 55, 0.15) 70px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 18px;
    width: 100%;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-2xl) 0;
}

.jawi-title {
    font-family: 'Playfair Display', serif;
    color: var(--brand);
    font-size: clamp(1.3rem, 3.6vw, 2rem);
    margin-bottom: 0.6rem;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.15;
    margin: 0.2rem 0 1rem;
    color: #000;
}

.hero p {
    color: var(--muted);
    font-size: clamp(0.98rem, 1.6vw, 1.1rem);
    margin: 0 auto 1.2rem;
    max-width: 720px;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(180deg, var(--brand), #e9c654);
    color: #111;
    padding: 12px 26px;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

/* ========================
   SECTIONS
   ======================== */
.section {
    padding: clamp(36px, 7vw, 72px) 0;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-alt {
    background: #fafafa;
}

.section h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    text-align: center;
    margin: 0 0 1.6rem;
    color: #000;
}

/* ========================
   INFO CARDS
   ======================== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(14px, 3vw, 22px);
    margin-top: clamp(14px, 3vw, 22px);
}

.info-card {
    background: #fff;
    border: 1px solid var(--stroke);
    border-radius: 16px;
    padding: clamp(16px, 3.5vw, 22px);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.3s ease;
}

.info-card.visible,
.info-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.info-card h3 {
    color: #000;
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
}

.info-card h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--brand);
    border-radius: 3px;
    margin-top: 6px;
}

.info-card p {
    color: #374151;
    font-size: 0.98rem;
    line-height: 1.6;
}

/* ========================
   CALCULATOR FORM
   ======================== */
.calculator {
    background: #fff;
    border: 1px solid var(--stroke);
    border-radius: 20px;
    padding: clamp(18px, 4vw, 28px);
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto;
}

/* Progress Bar */
.progress-wrap {
    margin-bottom: var(--space-xl);
}

.progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), #e9c654);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 16.67%;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.step-indicator {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.step-indicator.active {
    background: var(--brand);
    color: #111;
    transform: scale(1.1);
}

.step-indicator.completed {
    background: #10b981;
    color: #fff;
}

/* Form Steps */
.form-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.form-step.active {
    display: block;
}

.form-step h3 {
    font-size: 1.3rem;
    margin-bottom: var(--space-lg);
    color: var(--text);
}

/* Form Groups */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: #111;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--stroke);
    border-radius: 12px;
    background: #fff;
    color: #111;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
    transform: scale(1.01);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

/* Button Grid for Marital Status */
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
}

.marital-btn {
    background: #fff;
    border: 2px solid var(--stroke);
    border-radius: 12px;
    padding: var(--space-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.marital-btn:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.marital-btn.active {
    background: var(--brand-200);
    border-color: var(--brand);
}

.marital-btn .icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
    display: block;
}

/* Icon Grid for Parents */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.icon-btn {
    background: #fff;
    border: 2px solid var(--stroke);
    border-radius: 12px;
    padding: var(--space-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.icon-btn:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
}

.icon-btn.active {
    background: var(--brand-200);
    border-color: var(--brand);
}

.parent-btn .icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
    display: block;
}

/* Summary Box */
.summary-box {
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    padding: var(--space-lg);
}

.summary-box h4 {
    margin-bottom: var(--space-md);
    color: var(--text);
}

#summaryContent {
    line-height: 1.8;
}

#summaryContent div {
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--stroke);
}

#summaryContent div:last-child {
    border-bottom: none;
}

/* Navigation Buttons */
.form-navigation {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    justify-content: space-between;
}

.btn-nav {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-prev {
    background: #f0f0f0;
    color: var(--text);
}

.btn-prev:hover {
    background: #e0e0e0;
}

.btn-next {
    background: var(--brand);
    color: #111;
}

.btn-next:hover {
    background: var(--brand-600);
    transform: translateY(-2px);
}

.calculate-btn {
    background: linear-gradient(180deg, var(--brand), #e9c654);
    color: #111;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ========================
   RESULTS SECTION
   ======================== */
.results {
    margin-top: var(--space-xl);
    background: #fff;
    border: 1px solid var(--stroke);
    padding: clamp(14px, 3.5vw, 20px);
    border-radius: 16px;
    display: none;
    animation: fadeInUp 0.8s ease;
}

.results h3 {
    color: #000;
    margin: 0 0 var(--space-lg);
    font-size: 1.25rem;
}

/* Estate Summary */
.estate-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--card);
    border-radius: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
}

.summary-item span {
    color: var(--muted);
    font-size: 0.9rem;
}

.summary-item strong {
    color: var(--text);
    font-size: 1.1rem;
}

.summary-item.highlight {
    padding-top: var(--space-md);
    border-top: 2px solid var(--brand);
}

.summary-item.highlight strong {
    color: var(--brand);
    font-size: 1.3rem;
}

/* Results Table */
.scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 640px;
    font-size: 0.98rem;
}

.results-table thead th {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, #fff, #f9f5ea);
    color: #111;
    border-bottom: 2px solid var(--brand);
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
}

.results-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--stroke);
}

.results-table tbody tr:hover {
    background: #fffaf0;
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

/* Chart Container */
.chart-container {
    width: 100%;
    height: clamp(280px, 48vw, 420px);
    background: #fff;
    border: 1px dashed var(--stroke);
    border-radius: 12px;
    padding: clamp(10px, 3vw, 16px);
    position: relative;
    margin-top: var(--space-xl);
}

.chart-canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Insights Grid */
.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(14px, 3vw, 22px);
    margin: var(--space-xl) 0;
}

.insight-card {
    background: #fff;
    border: 1px solid var(--stroke);
    border-left: 4px solid var(--brand);
    border-radius: 12px;
    padding: clamp(14px, 3.5vw, 18px);
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.3s ease;
}

.insight-card.visible {
    opacity: 1;
    transform: translateX(0);
}

.insight-card h4 {
    margin: 0 0 0.4rem;
    color: #111;
}

.insight-card p {
    margin: 0;
    color: #374151;
    line-height: 1.6;
}

/* ========================
   VALUE PROPOSITION
   ======================== */
.value-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: clamp(14px, 3vw, 22px);
}

.value-item {
    text-align: center;
    padding: clamp(14px, 3.5vw, 18px);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.3s ease;
}

.value-item.visible,
.value-item.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.value-icon {
    width: clamp(56px, 10vw, 72px);
    height: clamp(56px, 10vw, 72px);
    background: linear-gradient(180deg, var(--brand), #e9c654);
    border-radius: 50%;
    margin: 0 auto 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #111;
}

.value-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.value-item p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========================
   HADITH & DISCLAIMER
   ======================== */
.hadith-quote {
    background: #fff;
    border: 1px solid var(--stroke);
    border-radius: 16px;
    padding: clamp(16px, 4vw, 24px);
    text-align: center;
    box-shadow: var(--shadow);
    transition: 0.3s;
    max-width: 800px;
    margin: 0 auto;
}

.hadith-quote:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.hadith-text {
    font-style: italic;
    color: #374151;
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: var(--space-md);
}

.hadith-source {
    color: #111;
    font-weight: 700;
    font-size: 0.95rem;
}

.disclaimer {
    background: #fff;
    border: 1px solid var(--stroke);
    border-left: 4px solid var(--brand);
    border-radius: 12px;
    padding: clamp(12px, 3vw, 16px);
    font-style: italic;
    color: #374151;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========================
   FOOTER
   ======================== */
.footer {
    background: #fff;
    border-top: 1px solid #eee;
    text-align: center;
    padding: clamp(18px, 4vw, 28px) 0;
    color: #6b7280;
}

.footer p {
    margin: 0.5rem 0;
}

.footer strong {
    color: var(--brand);
}

/* ========================
   ANIMATIONS
   ======================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }

.slide-left {
    animation: slideInLeft 0.8s ease forwards;
}

.slide-right {
    animation: slideInRight 0.8s ease forwards;
}

/* ========================
   RESPONSIVE DESIGN
   ======================== */
@media (max-width: 1024px) {
    .links a {
        padding: 10px 12px;
    }
}

@media (max-width: 820px) {
    /* Mobile Navigation */
    .menu-toggle {
        display: block;
    }

.links {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 60px);
        background: #fff;
        flex-direction: column;
        padding: 20px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        overflow-y: auto;
    }

.links.active {
        right: 0;
    }

.links a {
        width: 100%;
        text-align: left;
        padding: 12px 16px;
        margin: 4px 0;
    }

/* Form adjustments */
    .form-row {
        grid-template-columns: 1fr;
    }

.button-grid {
        grid-template-columns: 1fr;
    }

.icon-grid {
        grid-template-columns: repeat(2, 1fr);
    }

/* Table responsiveness */
    .results-table {
        font-size: 0.85rem;
    }

.results-table th,
    .results-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    /* Hero adjustments */
    .hero {
        min-height: 60vh;
    }

.hero h1 {
        font-size: 1.8rem;
    }

/* Section spacing */
    .section {
        padding: 30px 0;
    }

/* Cards and grids */
    .info-grid,
    .value-grid,
    .insight-grid {
        grid-template-columns: 1fr;
    }

/* Calculator */
    .calculator {
        padding: 15px;
        border-radius: 15px;
    }

/* Progress indicators */
    .step-indicator {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

/* Forms */
    .form-navigation {
        flex-direction: column;
    }

.btn-nav,
    .calculate-btn {
        width: 100%;
    }

/* Estate summary */
    .estate-summary {
        grid-template-columns: 1fr;
    }
}

/* ========================
   PRINT STYLES
   ======================== */
@media print {
    .nav,
    .form-navigation,
    .cta-button {
        display: none;
    }

.section {
        page-break-inside: avoid;
    }

.results-table {
        font-size: 10pt;
    }

.chart-container {
        max-height: 300px;
    }
}