:root {
    --bg-body: #f8f9fa;
    --box-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #6c757d;
    --primary-color: #163300;
    --primary-hover: #9FE870;
    --border-color: #dee2e6;
    --nav-bg: #ffffff;
    --nav-border: #eaeaea;
    --footer-bg: #212529;
    --footer-text: #f8f9fa;
    --footer-muted: #adb5bd;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --danger-color: #dc3545;
    --danger-hover: #c82333;
}

.dark-mode {
    --bg-body: #121212;
    --box-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --primary-color: #46a300;
    --primary-hover: #9FE870;
    --border-color: #333333;
    --nav-bg: #1a1a1a;
    --nav-border: #2d2d2d;
    --footer-bg: #000000;
    --footer-text: #e0e0e0;
    --footer-muted: #888888;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
}

/* Typography & General */
h1,
h2,
h3,
h4 {
    color: var(--text-color);
    margin-top: 0;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* AdSense Banners */
.ad-banner,
.ad-sidebar {
    background: repeating-linear-gradient(45deg, var(--border-color), var(--border-color) 10px, var(--box-bg) 10px, var(--box-bg) 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--text-muted);
    text-align: center;
    margin: 15px auto;
}

.ad-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
    padding: 10px;
}

.top-ad,
.pre-footer-ad {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
}

.in-content-ad {
    max-width: 336px;
    min-height: 280px;
    margin: 2rem auto;
}

.sidebar-ad {
    width: 100%;
    max-width: 300px;
    min-height: 250px;
    margin: 0 auto;
}

/* Navbar Fixed */
.navbar {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    padding: 0.5rem 1rem;
    transition: background-color 0.3s;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-logo:hover {
    text-decoration: none;
}

.nav-toggle {
    display: none;
    font-size: 1.8rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0 10px;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0 2rem 0 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: var(--box-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
}

.lang-selector select {
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
    background: var(--box-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

/* Layout Containers */
.main-container,
.page-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.page-container {
    justify-content: center;
}

.left-col,
.page-content {
    flex: 2;
    min-width: 300px;
}

.right-col,
.page-sidebar {
    flex: 1;
    min-width: 280px;
}

.page-content {
    background: var(--box-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.content-body p,
.content-body li {
    line-height: 1.6;
    font-size: 1.05rem;
}

.content-body h2 {
    margin-top: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* Textarea & Counters */
.textarea-wrapper {
    position: relative;
    background: var(--box-bg);
    padding: 1px;
    border-radius: 8px;
}

.textarea-wrapper textarea {
    width: 100%;
    height: 320px;
    padding: 1.5rem;
    font-size: 1.15rem;
    background: var(--box-bg);
    color: var(--text-color);
    border: 1px solid transparent;
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
    line-height: 1.5;
    transition: border-color 0.2s;
    margin: 10px 0;
}

.textarea-wrapper textarea:focus {
    outline: none;
    /*border-color: var(--primary-color);*/
}

.textarea-actions {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
}

.action-btn,
.action-btn-outline {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.action-btn {
    background: var(--primary-color);
    color: #fff;
}

.action-btn:hover {
    background: var(--primary-hover);
}

.action-btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.action-btn-outline:hover {
    background: var(--primary-color);
    color: #fff;
}

.counters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    border-top: 1px solid var(--border-color);
    /*background-color: #0000000f;*/
}

.counter-box {
    background: var(--box-bg);
    /*padding: 13PX 0px;*/
    /*text-align: center;*/
    /*transition: transform 0.2s;*/
    flex: 1;
    min-width: 120px;
    padding: 1.25rem 1rem;
    text-align: left;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/*.counter-box:hover {*/
/*    transform: translateY(-2px);*/
/*    box-shadow: var(--shadow-md);*/
/*}*/

.counter-box h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.70rem;
    color: var(--text-muted);
    /*text-transform: uppercase;*/
    letter-spacing: 0.5px;
}

.counter-box p {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}
.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-color);
    background: white;
}
.footer-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.footer-stats strong {
    color: var(--text-color);
    font-weight: 700;
}
.footer-actions {
    display: flex;
    gap: 1rem;
}
/* Density & Stopwords */
.keyword-density,
.stopwords-manager {
    background: var(--box-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    margin-top: 2rem;
}

.density-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.density-header h2 {
    margin: 0;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.dark-mode th {
    background: rgba(255, 255, 255, 0.05);
}

.add-stopword {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.add-stopword input {
    flex: 1;
    padding: 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-body);
    color: var(--text-color);
}

.add-stopword button {
    padding: 0 1.25rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

#stopwords_list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

#stopwords_list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.del-btn {
    background: var(--danger-color);
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}

.del-btn:hover {
    background: var(--danger-hover);
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 1.5rem 1rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-col h4 {
    color: #fff;
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--footer-muted);
}

.footer-links a:hover {
    color: #fff;
    text-decoration: none;
}

.footer-languages {
    color: var(--footer-muted);
    line-height: 1.8;
    font-size: 0.9rem;
}

.footer-branding p {
    color: var(--footer-muted);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}
.footer-developer  {
    color: #bb970b;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}
.adsense-disclosure {
    font-size: 0.8rem;
    margin-top: 1rem !important;
}

.adsense-disclosure a {
    color: var(--primary-hover);
}

/* Forms */
.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-body);
    color: var(--text-color);
    font-family: inherit;
}

.contact-form .submit-btn {
    background: var(--primary-color);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
}

/* SEO Content Section */
.seo-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.box-container {
    background: var(--box-bg);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.seo-content h2 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.4rem;
}

.seo-content p {
    line-height: 1.6;
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.seo-content ul {
    line-height: 1.6;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.seo-content li {
    margin-bottom: 0.5rem;
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-msg {
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(20px);
    animation: toastFadeIn 0.3s forwards, toastFadeOut 0.3s forwards 4s;
    pointer-events: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@keyframes toastFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastFadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    padding: 0.25rem;
}
.danger-btn {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.danger-btn:hover {
    background: var(--danger-color);
    color: #fff;
}

/* RTL */
html[dir="rtl"] {
    text-align: right;
}

html[dir="rtl"] .nav-links {
    margin: 0 0 0 2rem;
}

html[dir="rtl"] th,
html[dir="rtl"] td {
    text-align: right;
}

html[dir="rtl"] .textarea-actions {
    right: auto;
    left: 10px;
}

html[dir="rtl"] .add-stopword {
    flex-direction: row;
}

html[dir="rtl"] #stopwords_list li {
    flex-direction: row-reverse;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--nav-bg);
        border-bottom: 1px solid var(--nav-border);
        padding: 1rem;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        gap: 1rem;
        margin: 0 0 1rem 0;
        width: 100%;
        text-align: center;
    }

    .nav-controls {
        width: 100%;
        justify-content: center;
    }

    .main-container,
    .page-container {
        flex-direction: column;
    }

    .counters {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}