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

:root{
    --max-width: 1100px;
    --brand-1: #4f46e5;
    --brand-2: #7c3aed;
    --muted: #6b7280;
    --surface: #f8fafc;
    --card-border: #e5e7eb;
}

body{
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 24px;
    color: #111827;
}

.container{
    max-width: var(--max-width);
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(2,6,23,0.12);
    overflow: hidden;
}

.header{
    background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
    color: #fff;
    padding: 28px 20px;
    text-align: center;
}

.header h1{ font-size: 2rem; font-weight: 700; }
.lead{ opacity: 0.95; margin-top: 6px; }

.main-content{ padding: 36px; }

.api-setup{ background: var(--surface); padding: 20px; border-radius: 12px; margin-bottom: 24px; border-left: 4px solid var(--brand-1); }

.input-group{ margin-bottom: 18px; }
.input-group label{ display:block; margin-bottom:6px; font-weight:600; color:#374151; }
.input-group input, .input-group textarea, .input-group select{ width:100%; padding:12px 14px; border:2px solid var(--card-border); border-radius:10px; font-size:15px; transition: box-shadow .18s ease, border-color .18s ease; }
.input-group input:focus, .input-group textarea:focus, .input-group select:focus{ outline:none; border-color:var(--brand-1); box-shadow:0 0 0 4px rgba(79,70,229,0.08); }

.input-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.btn{ background: linear-gradient(135deg,var(--brand-1),var(--brand-2)); color:#fff; border:none; padding:14px 20px; border-radius:10px; font-size:15px; font-weight:600; cursor:pointer; transition: transform .15s ease, box-shadow .15s ease; width:100%; }
.btn:hover{ transform:translateY(-2px); box-shadow:0 10px 28px rgba(79,70,229,0.18); }
.btn:disabled{ background:#9ca3af; cursor:not-allowed; box-shadow:none; transform:none; }

.loading{ text-align:center; padding:20px; }
.spinner{ border:4px solid #f3f4f6; border-top:4px solid var(--brand-1); border-radius:50%; width:40px; height:40px; animation:spin 1s linear infinite; margin:0 auto 12px; }
@keyframes spin{ to{ transform:rotate(360deg); } }

.results{ margin-top:22px; }

.keyword-category{ background:var(--surface); border-radius:12px; padding:18px; margin-bottom:18px; border-left:4px solid #10b981; }
.keyword-category h3{ color:#111827; margin-bottom:10px; font-size:1.12rem; }

.keyword-list{ display:grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap:12px; }
.keyword-item{ background:#fff; padding:12px; border-radius:8px; border:1px solid var(--card-border); transition:transform .12s ease, box-shadow .12s ease; cursor:pointer; }
.keyword-item:hover{ transform:translateY(-4px); box-shadow:0 8px 20px rgba(2,6,23,0.06); border-color:var(--brand-1); }
.keyword{ font-weight:600; color:#0f172a; margin-bottom:6px; }
.metrics{ display:flex; gap:10px; align-items:center; margin-bottom:8px; }
.metric{ font-size:12px; color:var(--muted); }
.difficulty{ padding:2px 8px; border-radius:6px; font-size:11px; font-weight:700; text-transform:uppercase; }
.difficulty.easy{ background:#dcfce7; color:#166534; }
.difficulty.medium{ background:#fef3c7; color:#92400e; }
.difficulty.hard{ background:#fecaca; color:#991b1b; }

.seo-tips{ background:linear-gradient(135deg,#f0f9ff,#e0f2fe); border-radius:12px; padding:18px; margin-top:18px; border-left:4px solid #0ea5e9; }
.tip{ background:#fff; padding:12px; border-radius:8px; margin-bottom:12px; border-left:3px solid #0ea5e9; }

.error{ background:#fef2f2; color:#b91c1c; padding:12px; border-radius:8px; border-left:4px solid #dc2626; margin-top:12px; }

.example-keywords{ display:flex; gap:10px; flex-wrap:wrap; margin-top:8px; }
.example-keyword{ background:var(--brand-1); color:#fff; padding:6px 12px; border-radius:20px; font-size:14px; cursor:pointer; border:none; }
.example-keyword:hover{ background:#3730a3; transform:scale(1.03); }

.muted{ color:var(--muted); font-size:0.95rem; }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

footer.site-footer{ padding:16px 20px; text-align:center; color:var(--muted); font-size:0.95rem; }

@media (max-width:900px){ .input-grid{ grid-template-columns: 1fr; } .main-content{ padding:20px; } .header h1{ font-size:1.5rem; } .keyword-list{ grid-template-columns:1fr 1fr; } }
@media (max-width:480px){ .keyword-list{ grid-template-columns:1fr; } .container{ margin:10px; } }