:root {
    --primary: #8b5cf6; /* Violet */
    --primary-hover: #7c3aed;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --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(139, 92, 246, 0.15) 0px, transparent 50%),
                      radial-gradient(at 100% 100%, rgba(236, 72, 153, 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), #ec4899);
    border-radius: 20px; margin-bottom: 16px; box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 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; }

/* Palette */
.palette-container {
    display: flex; height: 350px; border-radius: 16px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); margin-bottom: 25px;
}

.color-box {
    flex: 1; display: flex; flex-direction: column; position: relative;
    transition: flex 0.3s ease; cursor: pointer;
}
.color-box:hover { flex: 1.2; }

.color-fill {
    flex: 1; width: 100%; background: #000; transition: background 0.4s ease;
}

.color-info {
    height: 90px; background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(5px);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    border-right: 1px solid rgba(255,255,255,0.05); padding: 10px;
}
.hex-value { font-size: 1.2rem; font-weight: 800; color: #fff; text-transform: uppercase; margin-bottom: 5px;}
.rgb-value { font-size: 0.8rem; color: var(--text-muted); }

.copy-btn {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.5); border: none; color: #fff; width: 40px; height: 40px;
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    font-size: 18px; cursor: pointer; opacity: 0; transition: all 0.2s;
    backdrop-filter: blur(5px);
}
.color-box:hover .copy-btn { opacity: 1; top: 30px; }
.copy-btn:hover { background: rgba(0,0,0,0.8); transform: translateX(-50%) scale(1.1); }

/* Controls */
.controls { display: flex; justify-content: center; }
.btn-generate {
    background: linear-gradient(135deg, var(--primary), #ec4899);
    color: #fff; border: none; padding: 16px 40px; border-radius: 14px;
    font-size: 1.2rem; font-weight: 800; cursor: pointer; display: flex;
    justify-content: center; align-items: center; gap: 10px; transition: all 0.3s;
    box-shadow: 0 10px 20px -5px rgba(139, 92, 246, 0.5);
}
.btn-generate:hover { transform: translateY(-3px); box-shadow: 0 15px 25px -5px rgba(139, 92, 246, 0.6); }
.btn-generate:active { transform: translateY(0); }

/* Toast */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: #10b981; 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: 768px) {
    .palette-container { flex-direction: column; height: 500px; }
    .color-box { flex-direction: row; }
    .color-info { width: 150px; height: auto; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.05); }
    .copy-btn { top: 50%; left: 20px; transform: translateY(-50%); }
    .color-box:hover .copy-btn { left: 30px; top: 50%; }
    .copy-btn:hover { transform: translateY(-50%) scale(1.1); }
}


/* 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;
}
