/* --- CSS VARIABLES & RESET --- */
:root {
    --primary-color: #0f172a; /* Navy Blue */
    --accent-color: #cca43b; /* Gold */
    --text-light: #f8fafc;
    --text-dark: #334155;
    --bg-light: #ffffff;
    --bg-off-white: #f1f5f9;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

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

/* --- NAVIGATION --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--primary-color);
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 1px;
    z-index: 1001;
    /* Aligns the image and the text horizontally */
    display: flex;
    align-items: center;
    gap: 12px; 
}

.logo span { 
    color: var(--accent-color); 
}

/* Styles the SVG image */
.logo-icon {
    height: 35px; /* Adjust this height to match your font size */
    width: auto;
    display: block;
}

/* Mobile adjustment for the logo icon */
@media screen and (max-width: 768px) {
    .logo-icon {
        height: 28px;
    }
    .logo {
        font-size: 1.2rem;
    }
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    transition: color var(--transition-speed);
    font-size: 0.95rem;
}

.nav-links a:hover { color: var(--accent-color); }

.cta-btn {
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
    font-weight: bold;
    transition: transform var(--transition-speed);
    display: inline-block;
}

.cta-btn:hover {
    transform: translateY(-2px);
    background-color: #e0b646;
}

/* Hamburger Icon */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-light);
    transition: all 0.3s ease;
}

/* --- HERO SECTION --- */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.7)), 
                url('https://images.unsplash.com/photo-1560518883-ce09059eeffa?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-light);
    padding: 0 1rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInDown 1s ease-out;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    animation: fadeInUp 1s ease-out 0.5s backwards;
}

/* --- SECTIONS GENERAL --- */
section { padding: 5rem 5%; }

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

.section-title span { border-bottom: 3px solid var(--accent-color); }

/* --- ABOUT SECTION --- */
.about {
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    gap: 4rem;
}

.about-content { flex: 1; }

.about-image {
    flex: 1;
    height: 400px;
    background-color: #ddd;
    background-image: url('https://images.unsplash.com/photo-1556761175-5973dc0f32e7?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80');
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* --- SERVICES SECTION --- */
.services { background-color: var(--bg-off-white); }

.cards-container {
    display: grid;
    gap: 2rem;
    /* Default: Mobile (1 Column) handled via media queries below */
    grid-template-columns: 1fr;
}

/* Tablet: 2 Columns */
@media (min-width: 768px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 4 Columns */
@media (min-width: 1024px) {
    .cards-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

.card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform var(--transition-speed);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card:hover { transform: translateY(-10px); }
.icon { font-size: 2.5rem; color: var(--accent-color); margin-bottom: 1rem;}
.card h3 { margin-bottom: 1rem; color: var(--primary-color); }

/* --- NEW ISLAMIC SECTION --- */
.islamic { 
    background-color: var(--bg-light); 
}

.islamic-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
    align-items: center;
}

.islamic-intro { 
    flex: 1; 
    min-width: 300px; 
}

.islamic-intro h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.islamic-features {
    list-style: none;
    margin-top: 1.5rem;
}

.islamic-features li {
    font-size: 1.05rem;
    margin-bottom: 0.8rem;
    color: var(--text-dark);
}

.islamic-types {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.type-card {
    background: var(--bg-off-white);
    padding: 1.5rem;
    border-left: 5px solid var(--accent-color);
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform var(--transition-speed);
}

.type-card:hover {
    transform: translateX(5px);
}

.type-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

/* --- EIBOR SECTION (UPDATED BG) --- */
.eibor {
    background-color: var(--bg-off-white); /* Changed to Gray */
    text-align: center;
}

.eibor-container {
    max-width: 800px;
    margin: 0 auto;
    overflow-x: auto;
    box-shadow: 0 10px 15px rgba(0,0,0,0.05); /* Added shadow for better contrast */
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
}

th, td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background-color: var(--primary-color);
    color: var(--text-light);
    font-weight: 600;
}

tr:nth-child(even) { background-color: var(--bg-off-white); }

.disclaimer {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

/* --- CALCULATOR SECTION --- */
.calculator-section {
    background-color: var(--bg-light);
}

.calc-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--bg-off-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: 1fr 1fr; /* This creates the Side-by-Side (Half Screen) layout */
    gap: 3rem;
    align-items: center; /* Aligns the box vertically in the center */
}

.calc-inputs {
    width: 100%;
}

.input-group {
    margin-bottom: 1.5rem;
}

.label-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* --- CUSTOM RANGE SLIDERS (Fixed Visibility) --- */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 10px 0;
    cursor: pointer;
}

input[type=range]:focus {
    outline: none;
}

/* WebKit (Chrome, Safari, Edge) */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 4px;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    margin-top: -8px; /* Centers thumb vertically */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: 3px solid white;
}

/* Firefox */
input[type=range]::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 4px;
}

input[type=range]::-moz-range-thumb {
    height: 24px;
    width: 24px;
    border: 3px solid white;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.input-field {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    color: var(--text-dark);
    background: #ffffff;
}

/* --- RESULT BOX STYLING (Restored) --- */
.result-box {
    background-color: var(--primary-color); /* Dark Blue Background */
    color: white; /* White Text */
    padding: 2.5rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
    height: 100%; /* Ensures it matches the height of inputs if needed */
}

.result-box h3 {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.monthly-payment {
    font-size: 3.5rem;
    font-weight: bold;
    color: var(--accent-color); /* Gold Text */
    margin: 0.5rem 0 1.5rem 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.result-details p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    opacity: 0.9;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

.result-details strong {
    color: white;
}
/* --- FAQ SECTION (UPDATED BG) --- */
.faq { background-color: var(--bg-off-white); /* Changed to Gray */ }

.faq-container {
    max-width: 1000px;
    margin: 0 auto;
}

.faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.faq-group-title {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
    opacity: 0.8;
}

details {
    background: #ffffff; /* Changed to White */
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow: hidden;
    height: fit-content;
}

summary {
    padding: 1.2rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
    list-style: none;
    position: relative;
    transition: background 0.3s;
    padding-right: 3rem;
}

summary:hover { background-color: #f1f5f9; }

summary::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--accent-color);
    transition: transform 0.3s;
}

details[open] summary::after { transform: translateY(-50%) rotate(45deg); }

.faq-answer {
    padding: 1.2rem;
    border-top: 1px solid #cbd5e1;
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 0.95rem;
}

.faq-answer ul {
    margin-top: 0.5rem;
    margin-left: 1.5rem;
    list-style-type: disc;
}

.faq-answer li {
    margin-bottom: 0.3rem;
}

@media screen and (max-width: 768px) {
    .faq-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* --- CONTACT SECTION (UPDATED BG) --- */
.contact { 
    text-align: center; 
    background-color: var(--bg-light); /* Changed to White */ 
}

.contact-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-off-white); /* Changed to Gray */
    padding: 3rem 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    text-align: left;
}

input, textarea {
    padding: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    transition: border-color 0.3s;
    background: #ffffff; /* Ensure white inputs on gray bg */
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(204, 164, 59, 0.1);
}

button[type="submit"] {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 1rem;
}

button[type="submit"]:hover {
    background-color: #1e293b;
    transform: translateY(-2px);
}

/* --- FOOTER --- */
footer {
    background-color: var(--primary-color);
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
}

/* --- ANIMATION CLASSES --- */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* ========================================= */
/* === MEDIA QUERIES (RESPONSIVE LOGIC) === */
/* ========================================= */

@media screen and (max-width: 768px) {
    /* 1. Mobile Navigation */
    .hamburger { display: flex; }
    .nav-links {
        position: absolute;
        top: 70px;
        right: 0;
        height: 60vh;
        width: 100%;
        background-color: var(--primary-color);
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 2rem;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
        opacity: 0.98;
    }
    .nav-links.nav-active { transform: translateX(0%); }

    /* 2. Layout Adjustments */
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1rem; padding: 0 1rem; }
    .about { flex-direction: column; gap: 2rem; }
    .about-image { width: 100%; height: 300px; }
    .calc-wrapper { grid-template-columns: 1fr; gap: 2rem; } 
    section { padding: 3rem 5%; }
    .section-title { font-size: 2rem; }
    th, td { font-size: 0.9rem; padding: 0.8rem 0.5rem; }
}