/* assets/css/style.css */

/* Import Google Font for Heading */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@700&display=swap');

/* 1. Define the custom Arabic font */
@font-face {
    font-family: 'Shuba';
    src: url('../fonts/shuba.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* --- Variable Warna Monokromatik Hijau (Lebih Soft) + Aksen --- */
:root {
    --color-primary: #66bb6a;
    --color-primary-light: #81c784;
    --color-primary-dark: #4caf50;
    --color-primary-darker: #388e3c;
    --color-text: #333;
    --color-background: #e8f5e9;
    --color-card-bg: #fff;
    --color-border: #a5d6a7;
    --color-hover-soft: rgba(255, 255, 255, 0.2);
    --color-dropdown-bg: #ffffff;
    --color-dropdown-text: var(--color-text);
    --color-dropdown-hover-bg: #f0f0f0;
    --color-accent: #42a5f5; /* Soft Blue */
    --color-accent-dark: #2196f3; /* Darker Soft Blue */

    /* --- Arabic Font Size Variable --- */
    /* Define a variable for Arabic font size */
    --arabic-font-size: 2.2rem; /* Default size for mobile */
    /* --- End Arabic Font Size Variable --- */
}

/* Base Styles */
body {
    font-family: sans-serif;
    line-height: 1.6;
    margin: 0;
    background-color: var(--color-background);
    color: var(--color-text);
    padding-bottom: 1px; /* Prevent margin collapse */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
}

/* Header Styling */
header {
    background-color: var(--color-primary-darker);
    color: white;
    padding: 0.8rem 0;
    position: relative;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding {
    display: flex;
    align-items: center;
    z-index: 101;
}

.site-logo img {
    height: 40px;
    vertical-align: middle;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
}

/* Desktop Navigation */
.desktop-nav {
    display: block;
}

.desktop-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.desktop-menu li {
    margin-left: 20px;
    position: relative;
}

.desktop-menu a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    transition: background-color 0.3s ease;
}

.desktop-menu a:hover {
    background-color: var(--color-hover-soft);
    border-radius: 4px;
}

/* Desktop Sub-menu */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--color-dropdown-bg);
    min-width: 180px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    z-index: 101;
    border-radius: 4px;
    overflow: hidden;
    padding: 5px 0;
}

.submenu li {
    margin: 0;
}

.submenu a {
    padding: 10px 15px;
    color: var(--color-dropdown-text);
    transition: background-color 0.2s ease;
}

.submenu a:hover {
    background-color: var(--color-dropdown-hover-bg);
    color: var(--color-text);
}

.desktop-menu li:hover > .submenu {
    display: block;
}

/* Hamburger Button */
.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.8rem;
    background: none;
    border: none;
    color: white;
    padding: 5px 10px;
    z-index: 102;
    transition: transform 0.3s ease;
}

.hamburger:focus {
    outline: none;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    width: 100%;
    background-color: var(--color-primary-darker);
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 99;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.mobile-menu.mobile-menu-open {
    max-height: 500px;
    opacity: 1;
}

.mobile-menu ul {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.mobile-menu ul li {
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu ul li:last-child {
    border-bottom: none;
}

.mobile-menu a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.mobile-menu a:hover {
    background-color: var(--color-primary-dark);
}

/* Mobile Sub-menu */
.mobile-menu .submenu {
    position: static;
    display: block;
    background-color: rgba(0, 0, 0, 0.1);
    box-shadow: none;
    border-radius: 0;
    min-width: auto;
    padding-left: 0;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.mobile-menu .submenu.submenu-open {
    max-height: 300px;
    opacity: 1;
}

.mobile-menu .submenu li {
    border-bottom: none;
}

.mobile-menu .submenu a {
    padding: 10px 30px;
    font-size: 0.9em;
}

/* Transition Effects */
[x-transition] {
    transition: all 0.3s ease;
}

/* Hero Section (UPDATED) */
.hero {
    color: white; /* Keep text white */
    text-align: center;
    padding: 4rem 0 3rem;
    margin-bottom: 1px;
    position: relative; /* Needed for absolute positioning of overlay */
    overflow: hidden; /* Hide parts of image if it overflows */
    /* Restore original background image and color */
    background-image: url('../img/hero-bg.jpg'); /* Ganti dengan path imej anda */
    background-size: cover;
    background-position: center;
    background-color: var(--color-primary); /* Fallback color */
}

/* Overlay for Hero Section */
.hero-background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Adjust the color and opacity as needed */
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black overlay (50% opacity) */
    z-index: 1; /* Ensure overlay is below content but above background image */
}

.hero-content {
    position: relative;
    z-index: 2; /* Ensure content is above overlay */
    /* Existing styles are fine, maybe adjust padding if needed */
}

/* Apply animation to hero content elements (KEPT) */
@keyframes zoomInFade {
    0% {
        opacity: 0;
        transform: scale(0.95); /* Start slightly smaller */
    }
    100% {
        opacity: 1;
        transform: scale(1); /* End at normal size */
    }
}

.hero-content h1,
.hero-content p,
.hero-content .search-form {
    opacity: 0; /* Hide elements initially */
    animation-name: zoomInFade;
    animation-duration: 0.8s; /* Adjust duration as needed */
    animation-timing-function: ease-out; /* Smooth animation */
    animation-fill-mode: forwards; /* Keep the final state (visible) */
}

/* Add delays for sequential animation (KEPT) */
.hero-content h1 {
    animation-delay: 0.2s;
}

.hero-content p.hero-subheading {
    animation-delay: 0.4s;
}

.hero-content p.hero-source {
    animation-delay: 0.6s;
}

.hero-content .search-form {
    animation-delay: 0.8s;
}


.hero h1 {
    margin-top: 0;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Gaya untuk subheading ayat Quran (Hanya terjemahan) */
.hero-subheading {
    font-size: 1.1rem;
    font-style: italic;
    margin: 1rem 0 0.5rem;
    line-height: 1.8; /* Line height default */
    text-align: center;
}

.hero-source {
    font-size: 0.9rem;
    margin-bottom: 2.5rem;
    text-align: center;
}

/* Search Form Styling */
.search-form {
    display: inline-flex; /* Default for desktop */
    align-items: center;
    border-radius: 4px;
    overflow: hidden;
    background-color: white;
    border: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
    position: relative; /* Needed for z-index */
    z-index: 2; /* Ensure search form is above overlay */
}

.search-form input[type="text"] {
    padding: 12px 15px;
    font-size: 1.1rem;
    border: none;
    outline: none;
    flex-grow: 1;
}

.search-form button {
    padding: 12px 20px;
    font-size: 1.1rem;
    border: none;
    background-color: var(--color-accent);
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-form button:hover {
    background-color: var(--color-accent-dark);
}

/* Tabs Section */
.tabs-section {
    padding: 2rem 0 3rem;
    background-color: var(--color-background);
    margin-bottom: 1px; /* Prevent margin collapse */
}

.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.tab-button {
    background-color: #eee;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1rem;
    margin: 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.tab-button.active {
    background-color: var(--color-primary);
    color: white;
}

.tab-content {
    margin-top: 1.5rem;
}

/* Doa Cards Section */
.doa-cards-section {
    padding: 2rem 0 3.5rem;
    background-color: var(--color-background);
}

.doa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 1.5rem;
}

.doa-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-primary-light);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    padding-top: 35px;
}

.doa-number {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 25px;
    height: 25px;
    background-color: var(--color-primary);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 25px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 1;
}

body.share-page .doa-number {
    display: none;
}

body.share-page .doa-card {
    padding-top: 20px;
}

/* --- Arabic Text Styling (Using Variable) --- */
.doa-card .arabic-text {
    font-family: 'Shuba', sans-serif;
    font-size: var(--arabic-font-size); /* Use the variable here */
    text-align: right;
    margin-bottom: 15px;
    line-height: 2;
    direction: rtl;
}

@media (min-width: 769px) {
    /* Override the variable for larger screens */
    :root {
         --arabic-font-size: 2.2rem; /* Larger size for desktop */
    }
    /* The .doa-card .arabic-text rule will automatically use this new value */
}
/* --- End Arabic Text Styling --- */


.doa-card .translation {
    font-style: italic;
    color: var(--color-text);
    margin-bottom: 15px;
}

.doa-card .reference {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.doa-card .usage {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 15px;
}

.card-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: right;
}

body.share-page .card-footer {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    text-align: center;
}

.back-button-container {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
}

.share-button {
    display: inline-block;
    background-color: var(--color-primary);
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.share-button:hover {
    background-color: var(--color-primary-dark);
}

.highlight {
    background-color: yellow;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 2px;
}

/* Feature Cards Section */
.feature-cards-section {
    /* Padding bawah yang mencukupi - Ditingkatkan */
    padding: 3rem 0 5rem;
    background-color: var(--color-primary-light);
    text-align: center;
}

/* Gaya untuk Tajuk "Anda juga mungkin berminat" */
.feature-cards-section h2 {
    /* Guna font Poppins dan warna putih */
    font-family: 'Poppins', sans-serif;
    color: white; /* Warna putih */
    margin-bottom: 0.5rem; /* Kurangkan margin bawah untuk dekat dengan subheading */
    font-size: 1.8rem;
    font-weight: 700;
    padding: 0 15px;
}

/* Gaya untuk Subheading "Anda juga mungkin berminat" (Baharu) */
.feature-cards-section .feature-subheading {
    font-size: 1.1rem;
    color: white; /* Warna putih */
    margin-top: 0; /* Buang margin atas */
    margin-bottom: 2.5rem; /* Tambah margin bawah untuk jarak dengan card */
    padding: 0 15px;
}


.feature-grid {
    display: grid; /* Kekalkan grid untuk desktop */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px; /* Jarak antara card (horizontal & vertical) */
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px; /* Padding sisi untuk grid */
}

.feature-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-primary-dark);
    border-radius: 10px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: var(--color-text);
    display: flex; /* Kekalkan flex untuk layout dalam card */
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--color-primary-darker);
}

.feature-card img {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    object-fit: contain;
}

.feature-card h4 {
    color: var(--color-primary-darker);
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.feature-card p {
    font-size: 0.95rem;
    line-height: 1.5;
    /* Kurangkan margin bawah untuk rapatkan dengan button */
    margin-bottom: 15px; /* Dikurangkan dari 20px */
    color: #555;
    flex-grow: 1;
    padding: 0 10px;
}

.feature-button {
    background-color: var(--color-primary);
    color: white;
    padding: 10px 25px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: auto;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.feature-card:hover .feature-button {
    background-color: var(--color-primary-dark);
    transform: scale(1.05);
}

/* Footer Styling */
footer {
    background-color: var(--color-primary-dark);
    color: white;
    text-align: center;
    padding: 2.5rem 0;
    margin-top: 1px; /* Prevent margin collapse */
}

footer a {
    color: white;
    text-decoration: underline;
    transition: color 0.3s ease;
}

footer a:hover {
    text-decoration: none;
    color: var(--color-hover-soft);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .mobile-menu {
        display: block;
    }

    /* Hero Section */
    .hero {
        padding: 3rem 0 2rem;
    }

    .hero h1 {
        font-size: 2.2rem;
        margin-bottom: 1.2rem;
    }

    /* Perbaiki Line Height Subheading Hero pada Responsive */
    .hero-subheading {
        font-size: 1rem;
        line-height: 1.6; /* Rapatkan sedikit baris */
    }


    /* Search Form */
    .search-form {
        display: flex; /* Guna flexbox */
        flex-direction: column; /* Susun menegak */
        width: 90%;
        margin: 0 auto 1.5rem;
        background-color: transparent;
        border: none;
        border-radius: 0; /* Buang border-radius pada container */
        overflow: visible;
    }

    .search-form input[type="text"] {
        border-radius: 4px;
        margin-bottom: 10px;
        border: 1px solid var(--color-border);
        width: 100%; /* Input ambil lebar penuh */
        box-sizing: border-box; /* Include padding and border in element's total width and height */
    }

    /* Perbaiki Butang Cari pada Responsive - Sama Besar dengan Input */
    .search-form button {
        width: 100%; /* Butang ambil lebar penuh */
        border-radius: 4px;
        margin-left: 0;
        display: flex; /* Kekalkan flex untuk centering */
        justify-content: center;
        align-items: center;
        box-sizing: border-box; /* Include padding and border in element's total width and height */
        padding: 12px 20px; /* Kekalkan padding asal */
    }


    /* Tabs */
    .tabs {
        flex-direction: column;
        align-items: center;
    }

    .tab-button {
        width: 90%;
        margin: 5px 0;
    }

    /* Doa Cards */
    .doa-grid {
        grid-template-columns: 1fr;
        gap: 20px; /* Jarak antara card doa */
    }

    /* Feature Cards */
    .feature-cards-section {
        /* Padding bawah yang mencukupi untuk mobile - Ditingkatkan */
        padding: 2.5rem 0 4rem; /* Ditingkatkan sedikit untuk mobile juga */
    }

    .feature-grid {
        display: block; /* Tukar ke block layout pada mobile */
        gap: 0; /* Pastikan gap 0 apabila block */
    }

    .feature-card {
        margin-bottom: 20px; /* Tambah margin bawah untuk jarak antara card pada mobile */
    }

    .feature-card:last-child {
        margin-bottom: 0; /* Buang margin bawah pada card terakhir */
    }

    /* Gaya untuk Tajuk "Anda juga mungkin berminat" pada Mobile */
    .feature-cards-section h2 {
        font-size: 1.6rem; /* Kurangkan saiz font sedikit */
    }

    /* Gaya untuk Subheading "Anda juga mungkin berminat" pada Mobile */
    .feature-cards-section .feature-subheading {
        font-size: 1rem; /* Kurangkan saiz font sedikit */
    }
}

/* Style untuk menyembunyikan elemen apabila x-cloak aktif */
[x-cloak] { display: none !important; }