:root {
    --primary: #10b981; /* Emerald */
    --primary-hover: #059669;
    --accent: #3b82f6; /* Blue */
    
    --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(16, 185, 129, 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), var(--accent));
    border-radius: 20px; margin-bottom: 16px; box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 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; }

.generator-body { display: grid; grid-template-columns: 350px 1fr; gap: 30px; }

/* Controls */
.controls-section { background: var(--input-bg); padding: 25px; border-radius: 20px; border: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 15px; }
.controls-section h3 { font-size: 1.1rem; color: #fff; margin-bottom: 5px; border-bottom: 1px dashed var(--border-color); padding-bottom: 10px;}
.mt-20 { margin-top: 10px; }

.input-group { display: flex; flex-direction: column; gap: 8px; }
label { font-size: 0.95rem; font-weight: 600; color: var(--text-muted); }
input[type="text"], input[type="url"], input[type="email"] {
    width: 100%; background: var(--bg-color); border: 1px solid var(--border-color);
    color: var(--text-main); font-size: 1.05rem; padding: 12px 15px; border-radius: 12px;
    outline: none; transition: all 0.3s;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }

/* Custom Checkbox (Toggle) */
.toggle-container {
    display: flex; align-items: flex-start; gap: 12px; cursor: pointer; user-select: none;
    background: rgba(255,255,255,0.03); padding: 12px; border-radius: 10px; border: 1px solid transparent; transition: all 0.2s;
}
.toggle-container:hover { background: rgba(255,255,255,0.05); border-color: var(--border-color);}
.toggle-container input { display: none; }
.checkmark {
    width: 22px; height: 22px; background: var(--bg-color); border: 2px solid var(--border-color);
    border-radius: 6px; position: relative; flex-shrink: 0; margin-top: 2px; transition: all 0.2s;
}
.toggle-container input:checked ~ .checkmark { background: var(--primary); border-color: var(--primary); }
.checkmark:after {
    content: ""; position: absolute; display: none; left: 6px; top: 2px;
    width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.toggle-container input:checked ~ .checkmark:after { display: block; }
.toggle-text { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }
.toggle-text small { display: block; color: var(--primary); font-size: 0.8rem; font-weight: bold;}

.btn-generate {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; border: none; padding: 15px; border-radius: 12px;
    font-size: 1.1rem; font-weight: 800; cursor: pointer; display: flex;
    justify-content: center; align-items: center; gap: 10px; transition: all 0.3s; margin-top: 15px;
}
.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.5); }

/* Results */
.results-section { display: flex; flex-direction: column; gap: 15px; }
.result-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--border-color);}
.result-header h3 { color: #fff; font-size: 1.2rem; }

.copy-btns { display: flex; gap: 10px; }
.btn-copy, .btn-copy-html {
    background: transparent; border: 1px solid var(--primary); color: var(--primary);
    padding: 8px 15px; border-radius: 8px; font-weight: 600; cursor: pointer; display: flex;
    align-items: center; gap: 5px; transition: all 0.2s; font-size: 0.9rem;
}
.btn-copy-html { border-color: var(--accent); color: var(--accent); }
.btn-copy:hover { background: var(--primary); color: #fff; }
.btn-copy-html:hover { background: var(--accent); color: #fff; }

.policy-box {
    background: var(--input-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 30px;
    min-height: 400px; max-height: 500px; overflow-y: auto; color: #fff; line-height: 1.8;
}
.policy-box::-webkit-scrollbar { width: 8px; }
.policy-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }

.policy-box h1, .policy-box h2 { color: var(--primary); margin-bottom: 15px; margin-top: 25px; }
.policy-box h1:first-child { margin-top: 0; }
.policy-box p { margin-bottom: 15px; color: #cbd5e1; }
.policy-box ul { margin-bottom: 15px; padding-right: 20px; color: #cbd5e1; }
.policy-box li { margin-bottom: 8px; }
.policy-box a { color: var(--accent); text-decoration: none; }
.empty-state { text-align: center; color: var(--text-muted) !important; font-style: italic; margin-top: 150px; }

/* Toast */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: var(--primary); color: #fff; padding: 12px 25px; border-radius: 30px;
    font-weight: 700; font-size: 1rem; box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
    opacity: 0; transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); z-index: 1000;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* SEO */
.seo-content { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; padding: 25px; }
.seo-content h2 { font-size: 1.3rem; color: #fff; margin-bottom: 12px; }
.seo-content p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.8; margin-bottom: 10px; }
.seo-content strong { color: var(--primary); }

.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: 850px) {
    .generator-body { 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;
}
