/* RTL layout support */
[dir="rtl"] body {
    direction: rtl;
    text-align: right;
    font-family: 'Noto Nastaliq Urdu', serif;
}

[dir="rtl"] .wc-container,
[dir="rtl"] .tool-content,
[dir="rtl"] .tool-sidebar {
    direction: rtl;
    text-align: right;
}

/* Input boxes, buttons */
[dir="rtl"] input,
[dir="rtl"] textarea {
    text-align: right;
}

/* FAQ arrow rotate fix */
[dir="rtl"] .faq-question i {
    transform: rotate(180deg);
}

/* Steps section alignment */
[dir="rtl"] .step-box {
    text-align: right;
}

/* Right-sidebar reverse padding fix */
[dir="rtl"] .sidebar-section {
    padding-right: 0;
    padding-left: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f8f8;
    color: #1f2937;
    line-height: 1.6;
    transition: all 0.3s ease;
}
body.dark-mode {
    background: #121212;
    color: #e0e0e0;
}
header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #FFFFFF;
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(16,185,129,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.dark-mode header {
    background: linear-gradient(135deg, #0d8f68 0%, #047857 100%);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo span {
    background: #FFFFFF;
    color: #10b981;
    padding: 6px 16px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-weight: 900;
}
.dark-mode .logo span {
    background: #1e1e1e;
    color: #10b981;
}
nav ul { display: flex; list-style: none; gap: 30px; align-items: center; }
nav a {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s;
}
nav a:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }
.mobile-menu { display: none; font-size: 1.5rem; cursor: pointer; }

.hero {
    text-align: center;
    padding: 60px 20px 50px;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: #FFFFFF;
    margin-bottom: 50px;
}
.dark-mode .hero {
    background: linear-gradient(135deg, #0d8f68 0%, #2bb981 100%);
}
.hero h1 { font-size: 3rem; margin-bottom: 15px; font-weight: 800; }
.hero p { font-size: 1.2rem; max-width: 700px; margin: 0 auto 30px; }

/* SEARCH BOX CONTAINER */
.search-box {
    display: flex;
    background: #FFFFFF;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(16,185,129,0.2);
    max-width: 520px;
    margin: 0 auto;
}

/* DARK MODE CONTAINER BACKGROUND */
.dark-mode .search-box {
    background: #1e1e1e;
}

/* INPUT - LIGHT MODE */
.search-box input {
    flex: 1;
    padding: 16px 25px;
    border: none;
    font-size: 1rem;
    outline: none;
    background: transparent;
    color: #000 !important;       /* Light mode text visible */
}

/* LIGHT MODE PLACEHOLDER */
.search-box input::placeholder {
    color: #666 !important;
}

/* INPUT - DARK MODE */
.dark-mode .search-box input {
    color: #fff !important;        /* Dark mode text white */
}

/* DARK MODE PLACEHOLDER */
.dark-mode .search-box input::placeholder {
    color: #aaa !important;
}

/* SEARCH BUTTON */
.search-box button {
    background: #059669;
    color: #FFFFFF;
    border: none;
    padding: 0 35px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

/* BUTTON HOVER */
.search-box button:hover {
    background: #047857;
}

.reset-inline-btn {
    background: #ef4444;   /* red */
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.2s;
}

.reset-inline-btn:hover {
    background: #dc2626;
}

.dark-mode .reset-inline-btn {
    background: #b91c1c;
}

.dark-mode .reset-inline-btn:hover {
    background: #991b1b;
}


.container { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }
.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: #059669;
    margin-bottom: 50px;
    font-weight: 700;
}
.dark-mode .section-title {
    color: #10b981;
}
.section-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #059669);
    margin: 15px auto;
    border-radius: 3px;
}
.tools-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}
.tool-card {
    background: #FFFFFF;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 35px rgba(16,185,129,0.1);
    transition: all 0.4s;
    text-align: center;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}
.dark-mode .tool-card {
    background: #1e1e1e;
    box-shadow: 0 10px 35px rgba(16,185,129,0.05);
}
.tool-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 50px rgba(16,185,129,0.2);
    border-color: #10b981;
}
.tool-icon { font-size: 2.5rem; margin-bottom: 10px; }
.tool-card h3 { color: #059669; margin: 10px 0 8px; font-size: 1.2rem; }
.dark-mode .tool-card h3 { color: #10b981; }
.tool-card p { color: #666; font-size: 0.9rem; margin-bottom: 15px; }
.dark-mode .tool-card p { color: #aaa; }
.tool-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #FFFFFF;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(16,185,129,0.3);
    transition: all 0.3s;
    font-size: 0.9rem;
    margin-top: auto;
}
.tool-btn:hover { transform: scale(1.05); box-shadow: 0 10px 30px rgba(16,185,129,0.4); }

.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #FFFFFF;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(16,185,129,0.4);
    z-index: 999;
}

footer {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #FFFFFF;
    padding: 60px 20px 30px;
    margin-top: 100px;
}
.dark-mode footer {
    background: linear-gradient(135deg, #0d8f68 0%, #047857 100%);
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}
.footer-section h3 { margin-bottom: 20px; }
.footer-section a { color: #FFFFFF; text-decoration: none; opacity: 0.9; }
.footer-section a:hover { opacity: 1; text-decoration: underline; }
.footer-bottom { text-align: center; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.2); opacity: 0.8; }

/* Updated Footer */
footer {
    background: linear-gradient(135deg, #0d9668 0%, #047852 100%);
    color: #FFFFFF;
    padding: 70px 20px 30px;
    margin-top: 100px;
    position: relative;
}
.dark-mode footer {
    background: linear-gradient(135deg, #0d8f68 0%, #047857 100%);
    color: #FFFFFF;
    padding: 70px 20px 30px;
    margin-top: 100px;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #10b981, #34d399, #10b981);
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
    margin-bottom: 40px;
}
.footer-section h3 {
    margin-bottom: 25px;
    font-size: 1.4rem;
    position: relative;
    padding-bottom: 10px;
}
.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: #34d399;
    border-radius: 2px;
}
.footer-section p, .footer-section li {
    opacity: 0.9;
    margin-bottom: 12px;
    line-height: 1.6;
}
.footer-section ul {
    list-style: none;
}
.footer-section a {
    color: #FFFFFF;
    text-decoration: none;
    opacity: 0.9;
    transition: all 0.3s;
    display: inline-block;
}
.footer-section a:hover {
    opacity: 1;
    transform: translateX(5px);
    color: #d1fae5;
}
.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.15);
    opacity: 0.8;
    font-size: 0.9rem;
}
.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}
.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: all 0.3s;
}
.social-links a:hover {
    background: #10b981;
    transform: translateY(-3px);
}

/* Language and Dark Mode Buttons */
.header-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}
.lang-btn, .dark-mode-btn {
    background: rgba(255,255,255,0.2);
    color: #FFFFFF;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.lang-btn:hover, .dark-mode-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}
.lang-dropdown {
    position: relative;
    display: inline-block;
}
.lang-options {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #FFFFFF;
    min-width: 150px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1001;
}
.dark-mode .lang-options {
    background: #1e1e1e;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}
.lang-options a {
    color: #1f2937;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: all 0.3s;
}
.dark-mode .lang-options a {
    color: #e0e0e0;
}
.lang-options a:hover {
    background: rgba(16,185,129,0.1);
}
.lang-dropdown:hover .lang-options {
    display: block;
}


/* Language Dropdown */
.lang-dropdown {
    position: relative;
}

.lang-btn {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-btn i {
    font-size: 12px;
}

.lang-menu {
    position: absolute;
    top: 48px;
    right: 0;
    background: #fff;
    color: #333;
    width: 180px;
    padding: 10px 0;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: none;
    list-style: none;
    z-index: 999;
}

.dark-mode .lang-menu {
    background: #1e1e1e;
    color: #fff;
}

.lang-menu li {
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}

.lang-menu li:hover {
    background: #e6f7f1;
}

.lang-menu li.active {
    background: #059669;
    color: #fff;
}


/* ============= MEGA MENU FIX ============= */

.nav-item.dropdown {
    position: relative;
}

/* Dropdown hide by default */
.mega-menu {
    position: absolute;
    top: 100%;
    justify-self: center;
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    min-width: 700px;
    display: none;
    z-index: 999;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);

    /* 🔥 horizontal scroll only inside dropdown */
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    max-width: 90vw;
}

/* Show dropdown on hover */
.nav-item.dropdown:hover .mega-menu,
.mega-menu:hover {
    display: flex;
}

/* Columns inside mega menu */
.mega-column {
    min-width: 200px;
    margin-right: 25px;
    display: inline-block;
    vertical-align: top;
}

.mega-title {
    font-size: 16px;
    font-weight: bold;
    color: #059669;
    margin-bottom: 10px;
}

.mega-link {
    display: block;
    text-decoration: none;
    color: #333;
    padding: 4px 0;
    transition: 0.2s;
}

.mega-link:hover {
    color: #059669;
    padding-left: 4px;
}

/* Prevent whole page horizontal scrollbar */
body {
    overflow-x: hidden;
}


/*Alert Box Error*/
.alert-box {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    position: relative;
    border: 1px solid transparent;
    font-size: 15px;
}

.alert-danger {
    background: #ffe6e6;
    border-color: #ffb3b3;
    color: #b60000;
}

.alert-success {
    background: #e6ffed;
    border-color: #a6f3c1;
    color: #046c3a;
}

.alert-icon {
    font-size: 20px;
    margin-top: 2px;
}

.alert-text {
    flex: 1;
    line-height: 1.5;
    margin-top: 1px;
}

.alert-close {
    background: transparent;
    border: none;
    font-size: 22px;
    color: #555;
    cursor: pointer;
    position: absolute;
    top: 6px;
    right: 10px;
}

.alert-close:hover {
    color: #000;
}

/* keep or move to global CSS */
.right-sidebar { width:320px; display:flex; flex-direction:column; gap:18px; flex-shrink:0; }
.sb-card { background:#fff; padding:18px; border-radius:10px; border:1px solid #e5e7eb; box-shadow:0 2px 4px rgba(0,0,0,0.05); }
.sb-title { font-size:18px; font-weight:700; margin-bottom:12px; color:#059669; }
.sb-input { width:100%; padding:10px 12px; border-radius:8px; border:1px solid #dadada; font-size:15px; }
.sb-list { list-style:none; padding:0; margin:0; }
.sb-list li { margin-bottom:10px; }
.sb-list a { text-decoration:none; color:#333; font-weight:600; display:block; transition:0.18s; }
.sb-list a:hover { color:#059669; transform:translateX(3px); }
.sb-suggestions { position:absolute; left:0; right:0; top:calc(100% + 8px); z-index:1200; display:none; }

@media (max-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .mobile-menu { display: block; }
    nav ul { position: absolute; top: 70px; left: 0; right: 0; background: #10b981; flex-direction: column; padding: 20px; display: none; }
    nav ul.active { display: flex; }
    .hero h1 { font-size: 2.4rem; }
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
    .header-buttons { flex-direction: column; gap: 10px; }
}

@media (max-width: 576px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}


