:root {
    --primary: #14b8a6; /* Teal */
    --primary-hover: #0d9488;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --input-bg: rgba(15, 23, 42, 0.6);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Cairo', sans-serif; }

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(at 0% 0%, rgba(20, 184, 166, 0.15) 0px, transparent 50%),
                      radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    padding: 40px 20px;
    display: flex; justify-content: center; align-items: center;
}

.app-container { width: 100%; max-width: 1000px; display: flex; flex-direction: column; gap: 25px; }

.tool-card {
    background: var(--card-bg); backdrop-filter: blur(16px);
    border: 1px solid var(--border-color); border-radius: 24px; padding: 35px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.tool-header { text-align: center; margin-bottom: 30px; }
.icon-wrapper {
    display: inline-flex; justify-content: center; align-items: center;
    width: 70px; height: 70px; background: linear-gradient(135deg, var(--primary), #2dd4bf);
    border-radius: 20px; margin-bottom: 16px; box-shadow: 0 10px 25px -5px rgba(20, 184, 166, 0.5);
}
.icon-wrapper ion-icon { font-size: 36px; color: white; }
.tool-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.tool-header p { color: var(--text-muted); font-size: 1rem; }

.analyzer-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }

.editor-area { display: flex; flex-direction: column; gap: 15px; }
textarea {
    width: 100%; height: 350px; background: var(--input-bg);
    border: 1px solid var(--border-color); border-radius: 16px; padding: 20px;
    color: var(--text-main); font-size: 1.1rem; resize: none; outline: none;
    transition: all 0.3s;
}
textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2); }

.btn-analyze {
    background: linear-gradient(135deg, var(--primary), #2dd4bf);
    color: #fff; border: none; padding: 16px; border-radius: 14px;
    font-size: 1.1rem; font-weight: 800; cursor: pointer; display: flex;
    justify-content: center; align-items: center; gap: 10px; transition: all 0.3s;
}
.btn-analyze:hover { transform: translateY(-2px); }

.results-area {
    background: var(--input-bg); border: 1px solid var(--border-color);
    border-radius: 16px; padding: 20px; display: flex; flex-direction: column;
}
.results-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 15px;
}
.results-header h3 { font-size: 1.1rem; color: #fff; }
.results-header span { background: rgba(255,255,255,0.1); padding: 5px 10px; border-radius: 8px; font-size: 0.9rem; }

.keywords-list { flex: 1; overflow-y: auto; max-height: 300px; display: flex; flex-direction: column; gap: 10px; }
.empty-state { text-align: center; color: var(--text-muted); margin-top: 50px; }

.keyword-item {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,0.05); padding: 12px 15px; border-radius: 10px;
}
.kw-text { font-weight: 700; font-size: 1.1rem; }
.kw-stats { display: flex; gap: 15px; color: var(--text-muted); font-size: 0.9rem; }
.kw-percent { color: var(--primary); font-weight: 700; }

.cross-links { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; margin-top: 10px; }
.cross-link {
    background: var(--card-bg); color: var(--text-main); text-decoration: none;
    padding: 10px 20px; border-radius: 12px; display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--border-color); transition: all 0.3s;
}
.cross-link:hover { background: var(--primary); border-color: var(--primary); }
.home-link { background: rgba(255,255,255,0.1); }

.ads-container { width: 100%; display: flex; justify-content: center; }
.ads-placeholder { width: 100%; max-width: 728px; height: 90px; background: rgba(15, 23, 42, 0.5); border: 1px dashed rgba(255, 255, 255, 0.2); border-radius: 12px; display: flex; justify-content: center; align-items: center; color: var(--text-muted); }

@media (max-width: 768px) { .analyzer-grid { grid-template-columns: 1fr; } }


/* Light Mode Theme Auto-injected */
body.light-mode {
    --bg-color: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.85);
    --input-bg: rgba(255, 255, 255, 0.95);
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .tool-card, 
body.light-mode .article-container,
body.light-mode .seo-content {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #0f172a !important;
}

body.light-mode select, 
body.light-mode input, 
body.light-mode textarea {
    background: #fff;
    color: #0f172a;
    border-color: rgba(0,0,0,0.2);
}

body.light-mode .logo { color: #0f172a !important; text-shadow: none !important; }



/* Layout Fixes for Header & Footer */
body {
    display: block !important;
}
.app-container, .article-container {
    margin-left: auto !important;
    margin-right: auto !important;
}
