/*
Theme Name: FreeProToolz Dynamic
Theme URI: https://freeprotoolz.online
Author: Antigravity AI
Author URI: https://freeprotoolz.online
Description: A premium, dark mystic glassmorphism theme designed for fast-loading, AdSense-compliant health and esoteric calculators.
Version: 1.1.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.0
Text Domain: freeprotoolz
*/

:root {
    --bg-color: #0b0c10;
    --surface: #1f2833;
    --glass-bg: rgba(31, 40, 51, 0.6);
    --primary: #66fcf1;
    --secondary: #45a29e;
    --text-main: #c5c6c7;
    --text-light: #ffffff;
    --accent: #ffd700;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top right, rgba(69, 162, 158, 0.1), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(102, 252, 241, 0.1), transparent 40%);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Header & Menu ─────────────────────────────────────────── */
.site-header {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 62px;
    flex-wrap: nowrap;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    margin: 0;
    padding: 0;
    line-height: 1;
}

.site-title a {
    color: var(--text-light);
    font-size: 1.45rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.site-title span {
    color: var(--primary);
    text-shadow: 0 0 18px rgba(102,252,241,0.35);
}

/* Desktop Navigation — always visible above 768px */
.main-navigation {
    display: block;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.15rem;
    align-items: center;
    flex-wrap: nowrap;
}

.main-navigation a {
    color: rgba(197,198,199,0.82);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.1px;
    padding: 0.42rem 0.85rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
    display: block;
}

.main-navigation a:hover {
    color: var(--text-light);
    background: rgba(255,255,255,0.07);
}

/* Active menu item */
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current_page_ancestor > a {
    color: var(--primary);
    background: rgba(102,252,241,0.09);
    border-bottom: none;
    padding-bottom: 0.42rem;
}

/* ─── Main Content ───────────────────────────────────────────── */
#content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

/* ─── Hero Section ───────────────────────────────────────────── */
.hero-section {
    text-align: center;
    padding: 4rem 1rem;
}

.hero-section h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(102, 252, 241, 0.3);
}

.hero-section p {
    font-size: 1.2rem;
    color: var(--secondary);
    max-width: 600px;
    margin: 0 auto 3rem auto;
}

/* ─── Tools Grid ─────────────────────────────────────────────── */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.tool-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(102, 252, 241, 0.2);
}

.tool-card h2 {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.tool-card p {
    flex: 1;
    margin-bottom: 1rem;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: #000;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
    transition: transform 0.2s, opacity 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
}

.btn:hover {
    transform: scale(1.05);
    opacity: 0.95;
}

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
    background: #050608;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem 1rem 1rem 1rem;
    text-align: center;
    margin-top: auto;
}

.footer-nav {
    margin-bottom: 2rem;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    padding: 0;
}

.footer-nav a,
.footer-nav ul li a {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-nav a:hover,
.footer-nav ul li a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Fallback footer links (plain <a> tags) */
.footer-links-fallback {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.footer-links-fallback a {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links-fallback a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.site-info {
    font-size: 0.8rem;
    color: rgba(197, 198, 199, 0.5);
    line-height: 1.8;
}

/* ─── Page Content ───────────────────────────────────────────── */
.page-content {
    background: var(--glass-bg);
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.page-content h1,
.page-content h2,
.page-content h3 {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.page-content p {
    margin-bottom: 1.5rem;
}

/* ─── Calculator Styles ──────────────────────────────────────── */
.calc-wrapper {
    max-width: 700px;
    margin: 2rem auto 0;
}

.calc-form {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.calc-form label {
    display: block;
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 0.4rem;
    margin-top: 1.2rem;
    font-size: 0.95rem;
}

.calc-form label:first-child {
    margin-top: 0;
}

.calc-form input[type="date"],
.calc-form input[type="number"],
.calc-form input[type="text"],
.calc-form select,
.calc-form input[type="time"] {
    width: 100%;
    padding: 0.9rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--secondary);
    border-radius: 8px;
    color: var(--text-light);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.calc-form input:focus,
.calc-form select:focus {
    outline: none;
    border-color: var(--primary);
}

.calc-form .btn {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem;
    font-size: 1rem;
}

.calc-result {
    display: none;
    background: rgba(102, 252, 241, 0.05);
    border: 1px solid rgba(102, 252, 241, 0.2);
    border-radius: 16px;
    padding: 2rem;
    animation: fadeIn 0.4s ease forwards;
}

.calc-result.visible {
    display: block;
}

.calc-result h3 {
    color: var(--primary);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.result-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.result-item .value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
}

.result-item .label {
    font-size: 0.8rem;
    color: var(--text-main);
    margin-top: 0.3rem;
    display: block;
}

.result-insight {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--primary);
    border-radius: 4px;
    padding: 1rem 1.2rem;
    margin-top: 1rem;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-main);
}

.progress-bar-wrap {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    height: 12px;
    margin: 1rem 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 50px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    transition: width 0.8s ease;
}

.disclaimer-note {
    font-size: 0.78rem;
    color: rgba(197, 198, 199, 0.5);
    margin-top: 1.5rem;
    font-style: italic;
    text-align: center;
}

/* Zakat rows */
.zakat-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.zakat-row label {
    width: 160px;
    flex-shrink: 0;
    margin: 0;
}

.zakat-row input {
    flex: 1;
}

/* Autophagy stages */
.stage-list {
    list-style: none;
    margin-top: 1rem;
}

.stage-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.9rem;
}

.stage-list li:last-child { border-bottom: none; }

.stage-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--secondary);
    flex-shrink: 0;
    margin-top: 5px;
}

.stage-dot.reached { background: var(--primary); }

/* Matrix display */
.matrix-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.matrix-cell {
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 1.2rem 0.8rem;
    text-align: center;
}

.matrix-cell .arcana-num {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
    line-height: 1;
}

.matrix-cell .arcana-name {
    font-size: 0.75rem;
    color: var(--secondary);
    margin-top: 0.4rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.matrix-cell .arcana-label {
    font-size: 0.7rem;
    color: rgba(197,198,199,0.5);
    margin-top: 0.2rem;
    display: block;
}

/* ─── Blog single post ───────────────────────────────────────── */
.entry-header {
    margin-bottom: 2rem;
}

.entry-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--text-light);
    line-height: 1.3;
}

.entry-meta {
    color: var(--secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.entry-content {
    color: var(--text-main);
    line-height: 1.9;
}

.entry-content h2, .entry-content h3 {
    color: var(--text-light);
    margin: 2rem 0 0.8rem;
}

.entry-content p { margin-bottom: 1.4rem; }
.entry-content a { color: var(--primary); }
.entry-content ul, .entry-content ol { margin-left: 1.5rem; margin-bottom: 1.4rem; }
.entry-content li { margin-bottom: 0.4rem; }

/* ─── 404 ────────────────────────────────────────────────────── */
.error-404 {
    text-align: center;
    padding: 6rem 2rem;
}

.error-404 h1 {
    font-size: 8rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    text-shadow: 0 0 30px rgba(102,252,241,0.4);
}

.error-404 h2 {
    color: var(--text-light);
    font-size: 1.8rem;
    margin: 1rem 0;
}

.error-404 p {
    color: var(--secondary);
    max-width: 500px;
    margin: 0 auto 2rem;
}

/* ─── Forms (WPForms) ────────────────────────────────────────── */
.custom-wpforms-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.custom-wpforms-wrapper .wpforms-field-label {
    color: var(--text-main) !important;
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.custom-wpforms-wrapper input[type=text],
.custom-wpforms-wrapper input[type=email],
.custom-wpforms-wrapper input[type=number],
.custom-wpforms-wrapper textarea,
.custom-wpforms-wrapper select {
    width: 100% !important;
    padding: 1rem !important;
    background: rgba(0,0,0,0.3) !important;
    border: 1px solid var(--secondary) !important;
    border-radius: 8px !important;
    color: var(--text-light) !important;
    margin-bottom: 1.5rem !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
}

.custom-wpforms-wrapper input:focus,
.custom-wpforms-wrapper textarea:focus,
.custom-wpforms-wrapper select:focus {
    outline: none !important;
    border-color: var(--primary) !important;
}

.custom-wpforms-wrapper button[type=submit] {
    display: inline-block !important;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%) !important;
    color: #000 !important;
    padding: 0.8rem 1.5rem !important;
    border-radius: 8px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    border: none !important;
    cursor: pointer !important;
    font-family: inherit !important;
    transition: transform 0.2s !important;
}

.custom-wpforms-wrapper button[type=submit]:hover {
    transform: scale(1.05) !important;
}

/* ─── Mobile Hamburger Menu ──────────────────────────────────── */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-shrink: 0;
}

.hamburger-box {
    width: 30px;
    height: 24px;
    display: inline-block;
    position: relative;
}

.hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -2px;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    width: 30px;
    height: 3px;
    background-color: var(--primary);
    border-radius: 4px;
    position: absolute;
    transition: transform 0.15s ease;
}

.hamburger-inner::before,
.hamburger-inner::after {
    content: "";
    display: block;
}

.hamburger-inner::before { top: -8px; }
.hamburger-inner::after  { bottom: -8px; }

.menu-toggle.is-active .hamburger-inner { background-color: transparent; }
.menu-toggle.is-active .hamburger-inner::before { transform: translate3d(0, 8px, 0) rotate(45deg); }
.menu-toggle.is-active .hamburger-inner::after  { transform: translate3d(0, -8px, 0) rotate(-45deg); }

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
    .hero-section h1 { font-size: 2.2rem; }
}

@media (max-width: 768px) {
    .header-inner {
        height: auto;
        padding: 0.75rem 0;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .menu-toggle {
        display: block;
    }

    /* On mobile: hide nav by default, show when toggled */
    .main-navigation {
        display: none;
        width: 100%;
        margin-top: 0.5rem;
        padding: 0.75rem 0;
        border-top: 1px solid rgba(255,255,255,0.06);
    }

    .main-navigation.toggled {
        display: block;
        animation: fadeIn 0.25s ease forwards;
    }

    .main-navigation ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.1rem;
    }

    .main-navigation a {
        width: 100%;
        padding: 0.55rem 0.75rem;
        font-size: 0.95rem;
        border-radius: 7px;
    }

    .page-content {
        padding: 1.5rem;
    }

    .calc-form {
        padding: 1.2rem;
    }

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

    .hero-section { padding: 2.5rem 1rem; }
    .hero-section h1 { font-size: 1.9rem; }
    .hero-section p { font-size: 1rem; }

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

    .zakat-row { flex-direction: column; align-items: flex-start; }
    .zakat-row label { width: 100%; }
}

@media (max-width: 480px) {
    .site-title a { font-size: 1.25rem; }
    .entry-title { font-size: 1.6rem; }
    .error-404 h1 { font-size: 5rem; }
    .result-grid { grid-template-columns: 1fr 1fr; }
}
