:root {
  --bg: #050b14;
  --surface: rgba(13, 20, 36, 0.65);
  --border: rgba(59, 130, 246, 0.15);
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.4);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #f8fafc;
  --text-muted: #94a3b8;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(59,130,246,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 80% 100%, rgba(16,185,129,0.08) 0%, transparent 60%);
  overflow-x: hidden;
}

.app { max-width: 1200px; margin: 0 auto; padding: 2rem; display: flex; flex-direction: column; gap: 2rem; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); padding: 1.2rem 2rem;
  border-radius: 16px; border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.brand-title { 
  font-size: 1.4rem; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, #60a5fa, #34d399); 
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; 
}
.brand-sub { font-size: 0.85rem; color: var(--text-muted); font-weight: 500;}

.grid-cols { display: grid; grid-template-columns: 380px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 850px) { .grid-cols { grid-template-columns: 1fr; } }

.card { 
  background: var(--surface); border: 1px solid var(--border); 
  border-radius: 16px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  overflow: hidden; 
}
.card-header { padding: 1.2rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.card-title { font-size: 1.05rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem;}

.btn { 
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; 
  padding: 0.75rem 1.2rem; border-radius: 10px; font-size: 0.9rem; font-weight: 600; 
  cursor: pointer; border: none; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); color: white; 
}
.btn-primary { background: linear-gradient(135deg, var(--primary), #2563eb); box-shadow: 0 4px 15px var(--primary-glow); }
.btn-primary:hover { box-shadow: 0 6px 20px var(--primary-glow); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3); color: #60a5fa; }
.btn-secondary:hover { background: rgba(59, 130, 246, 0.2); }

.btn-cookie { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: #fbbf24; width: 100%;}
.btn-cookie:hover { background: rgba(245,158,11,0.2); }

.input-field {
  width: 100%; background: rgba(0,0,0,0.4); border: 1px solid var(--border); 
  color: white; padding: 0.85rem; border-radius: 10px; font-family: inherit;
  transition: all 0.2s; outline: none;
}
.input-field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.input-field::placeholder { color: rgba(255,255,255,0.3); }

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 1rem center; background-size: 1em;
}
select.input-field option { background: #0f172a; color: white; }

/* Login */
#loginOverlay { position: fixed; inset: 0; background: rgba(5,11,20,0.95); backdrop-filter: blur(10px); z-index: 999; display: flex; align-items: center; justify-content: center; }
.login-box { background: var(--surface); border: 1px solid var(--border); padding: 3rem 2.5rem; border-radius: 20px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 20px 40px rgba(0,0,0,0.4); }
.login-input { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--border); color: white; padding: 0.9rem; border-radius: 10px; margin-bottom: 1.2rem; font-family: inherit; transition: all 0.2s; outline:none;}
.login-input:focus { border-color: var(--primary); }

/* Cookie Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #0f172a; border: 1px solid var(--border); padding: 2.5rem; border-radius: 20px; width: 90%; max-width: 500px; box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.cookie-textarea { width: 100%; height: 140px; background: rgba(0,0,0,0.4); border: 1px solid var(--border); color: #60a5fa; padding: 1rem; font-family: monospace; font-size: 0.8rem; border-radius: 10px; margin: 1.5rem 0; resize: vertical; outline:none; }
.cookie-textarea:focus { border-color: #fbbf24; }

/* Tables & Logs */
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th { text-align: left; padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px;}
td { padding: 1.2rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.02); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.status-pill { padding: 0.3rem 0.7rem; border-radius: 12px; font-size: 0.75rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.status-success { background: rgba(16,185,129,0.1); color: #34d399; border: 1px solid rgba(16,185,129,0.2); }
.status-error { background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.status-running { background: rgba(245,158,11,0.1); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }

.log-details { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }
.log-err { color: #f87171; }
#cookieStatus { font-size: 0.85rem; padding: 0.4rem 1rem; border-radius: 12px; background: rgba(255,255,255,0.05); font-weight: 500; border: 1px solid rgba(255,255,255,0.1); }

.screenshot-link {
    text-decoration: none;
    margin-right: 8px;
    font-size: 1.1rem;
    transition: transform 0.2s;
    display: inline-block;
}

.screenshot-link:hover {
    transform: scale(1.2);
}
