@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

:root {
    --primary-color: #0D8ABC;
    --primary-hover: #0a6991;
    --secondary-color: #f3f4f6;
    --text-color: #333;
    --border-color: #e5e7eb;
    --bg-color: #f9fafb;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Tajawal', sans-serif;
    background-color: #eef2f5;
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

body[dir="ltr"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.app-container {
    max-width: 1200px;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.app-header {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
    padding: 30px;
    border-bottom: 4px solid var(--primary-color);
    position: relative;
}

.lang-switch {
    position: absolute;
    top: 20px;
    left: 20px;
}

body[dir="ltr"] .lang-switch {
    left: auto;
    right: 20px;
}

.lang-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
    transition: var(--transition);
}

.lang-btn:hover {
    background: rgba(255,255,255,0.2);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

.header-logo {
    width: 150px;
    height: auto;
    object-fit: contain;
}

.logo-area h1 {
    font-size: 26px;
    margin-bottom: 5px;
    font-weight: 800;
}

.logo-area p {
    color: #cbd5e1;
    font-size: 16px;
}

.app-main {
    padding: 30px;
}

/* Tool Section */
.input-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.textarea-wrapper {
    display: flex;
    flex-direction: column;
}

.textarea-wrapper label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #475569;
}

.keyword-input {
    height: 180px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

.keyword-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 138, 188, 0.2);
}

.add-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-family: inherit;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    margin-bottom: 30px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.add-btn:hover {
    text-decoration: underline;
}

.options-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: var(--bg-color);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.options-section h3 {
    margin-bottom: 15px;
    font-size: 16px;
    color: #1e293b;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    display: inline-block;
}

.checkbox-container, .radio-container {
    display: block;
    position: relative;
    padding-right: 30px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 15px;
    user-select: none;
}
body[dir="ltr"] .checkbox-container, body[dir="ltr"] .radio-container {
    padding-right: 0;
    padding-left: 30px;
}

.checkbox-container input, .radio-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark, .radiomark {
    position: absolute;
    top: 2px;
    right: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}
body[dir="ltr"] .checkmark, body[dir="ltr"] .radiomark {
    right: auto;
    left: 0;
}

.radiomark {
    border-radius: 50%;
}

.checkbox-container:hover input ~ .checkmark, 
.radio-container:hover input ~ .radiomark {
    background-color: #f1f5f9;
}

.checkbox-container input:checked ~ .checkmark,
.radio-container input:checked ~ .radiomark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after, .radiomark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after,
.radio-container input:checked ~ .radiomark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
body[dir="ltr"] .checkbox-container .checkmark:after {
    left: 6px; /* Still same relative to checkbox */
}

.radio-container .radiomark:after {
    top: 5px;
    left: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.action-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 30px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 138, 188, 0.3);
}

.status-msg {
    font-size: 15px;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 6px;
    display: none;
}

.status-msg.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.status-msg.success { 
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.status-msg.error { 
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-msg a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 900;
}

.result-section h3 {
    margin-bottom: 10px;
    color: #1e293b;
}

#result-textarea {
    width: 100%;
    height: 250px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    font-family: monospace;
    font-size: 15px;
    background-color: #f8fafc;
    margin-bottom: 15px;
    direction: ltr;
    text-align: left;
}

.result-actions {
    display: flex;
    gap: 15px;
}

.secondary-btn {
    background-color: #fff;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.secondary-btn:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

/* SEO Content Section */
.seo-content {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.seo-content h2 {
    color: #1e293b;
    margin-bottom: 15px;
    font-size: 24px;
}

.seo-content h3 {
    color: #334155;
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 20px;
}

.seo-content p {
    margin-bottom: 15px;
    color: #475569;
    line-height: 1.8;
}

.seo-content ul {
    margin-right: 25px;
    margin-bottom: 20px;
    color: #475569;
}
body[dir="ltr"] .seo-content ul {
    margin-right: 0;
    margin-left: 25px;
}

.seo-content li {
    margin-bottom: 8px;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 25px;
}

.seo-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.seo-table th, .seo-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}
body[dir="ltr"] .seo-table th, body[dir="ltr"] .seo-table td {
    text-align: left;
}

.seo-table th {
    background-color: #f1f5f9;
    color: #1e293b;
    font-weight: bold;
}

.proof-box {
    background-color: #f0fdf4;
    border-right: 4px solid #22c55e;
    padding: 15px 20px;
    border-radius: 6px;
    color: #166534;
    margin-bottom: 25px;
}
body[dir="ltr"] .proof-box {
    border-right: none;
    border-left: 4px solid #22c55e;
}

.author-box {
    background: linear-gradient(to right, #f8fafc, #eff6ff);
    border: 1px solid #bfdbfe;
    padding: 25px;
    border-radius: 12px;
    margin-top: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.author-box img {
    width: 120px;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    border: none;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.author-info h3 {
    margin-top: 0;
    color: #1e3a8a;
    margin-bottom: 5px;
}

.author-info p {
    margin-bottom: 10px;
    font-size: 15px;
}

.contact-btn {
    display: inline-block;
    background-color: #2563eb;
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    transition: var(--transition);
}

.contact-btn:hover {
    background-color: #1d4ed8;
}

.app-footer {
    text-align: center;
    padding: 20px;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
    color: #64748b;
    font-size: 14px;
}

.app-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.app-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .options-section {
        grid-template-columns: 1fr;
    }
    
    .logo-area {
        flex-direction: column;
        text-align: center;
    }
    
    .author-box {
        flex-direction: column;
        text-align: center;
    }
}

/* Hub Architecture & New UI Styles */
.top-trust-badge {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 15px;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.badge-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    direction: ltr; /* Keeps numbers and English words aligned correctly */
}
body[dir="rtl"] .badge-item.rtl-text {
    direction: rtl; /* Pure Arabic items */
}
.badge-separator {
    color: #cbd5e1;
}
.partner-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: bold;
}
.partner-link:hover { text-decoration: underline; }

.header-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}
.tools-search {
    display: flex;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
}
.search-input {
    border: none;
    padding: 8px 15px;
    outline: none;
    font-family: inherit;
    width: 180px;
}
.search-btn {
    background: transparent;
    border: none;
    padding: 0 15px;
    color: #64748b;
    cursor: pointer;
}

.tools-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0px;
    background: transparent;
    justify-content: center;
    margin-bottom: 25px;
}
.tools-nav a {
    text-decoration: none;
    color: #475569;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
    background: #fff;
    border: 1px solid #cbd5e1;
}
.tools-nav a:hover { background: #f1f5f9; }
.tools-nav a.active { background: #0D8ABC; color: #fff; border-color:#0D8ABC; }
.tools-nav a.stats-link { background: #10b981; color: #fff; border-color:#10b981; }
.tools-nav a.stats-link:hover { background: #059669; }

.text-center { text-align: center; }
.center-text { margin: 10px auto; text-align: center; }

.huge-btn {
    font-size: 18px;
    padding: 15px 40px;
    border-radius: 30px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
}
.huge-action-btn {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    font-family: inherit;
    text-align: center;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
.btn-primary-action {
    background-color: #0D8ABC;
    color: white;
    border: none;
}
.btn-primary-action:hover { background-color: #0a6b92; }

.btn-secondary-action {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.btn-secondary-action:hover { background-color: #e2e8f0; }

.full-width { width: 100%; display: flex; gap: 15px; margin-top:15px; }

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.result-badge {
    background-color: #10b981;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
    display: none;
}
.result-badge.active { display: inline-block; }

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}
.trust-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.trust-card i { font-size: 24px; color: #10b981; }

.faq-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
}
.faq-section h4 { color: #0f172a; margin-top: 15px; margin-bottom: 5px; }
.faq-section p { color: #475569; margin-top: 0; }

.changelog {
    background: #f8fafc;
    padding: 20px 40px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
}

.author-img-large {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
}
.author-title { color: #2563eb; font-weight: bold; font-size: 14px; margin-top: -10px; margin-bottom: 5px; }

.footer-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}
.footer-links a {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
}
.footer-links a:hover { text-decoration: underline; }
