:root {
    --whatsapp: #25d366; /* WhatsApp Green */
    --whatsapp-dark: #128c7e;
    --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(37, 211, 102, 0.15) 0px, transparent 50%),
                      radial-gradient(at 100% 100%, rgba(18, 140, 126, 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: 900px; 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(--whatsapp), var(--whatsapp-dark));
    border-radius: 20px; margin-bottom: 16px; box-shadow: 0 10px 25px -5px rgba(37, 211, 102, 0.5);
}
.icon-wrapper ion-icon { font-size: 40px; 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: 1fr 1fr; gap: 30px;
}

/* Inputs */
.inputs-section { display: flex; flex-direction: column; gap: 20px; }
.input-group { display: flex; flex-direction: column; gap: 8px; }
label { font-size: 0.95rem; font-weight: 600; color: var(--text-muted); }

.phone-input-wrapper {
    display: flex; align-items: center; background: var(--input-bg);
    border: 1px solid var(--border-color); border-radius: 14px; overflow: hidden;
    transition: all 0.3s;
}
.phone-input-wrapper:focus-within { border-color: var(--whatsapp); box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2); }

.plus-sign { padding: 15px 10px 15px 15px; color: var(--text-main); font-weight: bold; background: rgba(255,255,255,0.05); }
#country-code { width: 80px; background: transparent; border: none; border-left: 1px solid var(--border-color); color: var(--text-main); font-size: 1.1rem; padding: 15px 10px; outline: none; border-radius: 0; }
#phone-number { flex: 1; background: transparent; border: none; color: var(--text-main); font-size: 1.1rem; padding: 15px; outline: none; border-radius: 0; }

textarea {
    width: 100%; height: 120px; background: var(--input-bg); border: 1px solid var(--border-color);
    color: var(--text-main); font-size: 1rem; padding: 15px; border-radius: 14px;
    resize: none; outline: none; transition: all 0.3s;
}
textarea:focus { border-color: var(--whatsapp); box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2); }

.hint { color: var(--text-muted); font-size: 0.8rem; }

/* Results */
.results-section {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1), rgba(18, 140, 126, 0.05));
    border-radius: 20px; padding: 25px; border: 1px solid rgba(37, 211, 102, 0.2);
    display: flex; flex-direction: column; gap: 20px; align-items: center; text-align: center;
}

.link-preview { width: 100%; text-align: right; }
.generated-link {
    background: var(--bg-color); border: 1px solid var(--border-color);
    padding: 15px; border-radius: 12px; font-family: monospace; font-size: 0.9rem;
    color: var(--whatsapp); word-break: break-all; margin-top: 5px; min-height: 50px;
    display: flex; align-items: center; direction: ltr; text-align: left;
}

.actions { display: flex; gap: 10px; width: 100%; }
.btn-primary, .btn-secondary {
    flex: 1; padding: 12px; border-radius: 12px; font-weight: 700; font-size: 1rem;
    cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px; transition: all 0.3s; border: none;
}
.btn-primary { background: var(--whatsapp); color: #000; }
.btn-primary:hover { background: var(--whatsapp-dark); color: #fff; transform: translateY(-2px);}
.btn-secondary { background: transparent; border: 1px solid var(--whatsapp); color: var(--whatsapp); }
.btn-secondary:hover { background: rgba(37, 211, 102, 0.1); }

.qr-box { margin-top: 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-box p { color: var(--text-muted); font-size: 0.9rem; }
#qrcode { background: #fff; padding: 10px; border-radius: 10px; }
.btn-text { background: none; border: none; color: var(--text-muted); text-decoration: underline; cursor: pointer; font-family: 'Cairo'; margin-top: 5px;}
.btn-text:hover { color: #fff; }

/* Toast */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: var(--whatsapp); color: #000; padding: 12px 25px; border-radius: 30px;
    font-weight: 700; font-size: 1rem; box-shadow: 0 10px 20px rgba(37, 211, 102, 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(--whatsapp); }

.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) {
    .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;
}
