:root {
  --bg-main: #0f1014;
  --card-bg: rgba(24, 25, 32, 0.85);
  --card-border: rgba(255, 255, 255, 0.08);
  --netflix-red: #e50914;
  --netflix-red-hover: #b80710;
  --text-main: #f5f5f7;
  --text-muted: #9ba1a6;
  --accent-blue: #0071e3;
  --accent-green: #30d158;
  --accent-yellow: #ffd60a;
  --radius-lg: 16px;
  --radius-md: 10px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(229, 9, 20, 0.22) 0%, rgba(15, 16, 20, 0) 70%);
  z-index: 0;
  pointer-events: none;
}

/* Header */
.main-header {
  position: relative;
  z-index: 10;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
  background: rgba(15, 16, 20, 0.6);
  backdrop-filter: blur(12px);
}

.header-content {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  font-size: 1.75rem;
  background: rgba(229, 9, 20, 0.15);
  border: 1px solid rgba(229, 9, 20, 0.3);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-md);
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ffffff, #e50914);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.admin-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.2s ease;
}

.admin-link:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

/* Container */
.container {
  position: relative;
  z-index: 10;
  max-width: 680px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.25rem;
  flex: 1;
}

/* Service Selector Tabs */
.service-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.service-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.service-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.service-btn.active {
  background: rgba(229, 9, 20, 0.12);
  border-color: var(--netflix-red);
  color: var(--text-main);
  box-shadow: 0 0 15px rgba(229, 9, 20, 0.25);
}

/* Instructions Card */
.guide-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.step-num {
  background: rgba(229, 9, 20, 0.2);
  color: var(--netflix-red);
  border: 1px solid rgba(229, 9, 20, 0.4);
  font-size: 0.75rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-item p {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.step-item strong {
  color: var(--text-main);
}

/* Search Card */
.search-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  margin-bottom: 1.5rem;
}

.input-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1.25rem;
}

.input-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.1rem;
  pointer-events: none;
}

.input-group input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem 0.95rem 3rem;
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease;
}

.input-group input:focus {
  border-color: var(--netflix-red);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.2);
}

.primary-btn {
  width: 100%;
  background: var(--netflix-red);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

.primary-btn:hover {
  background: var(--netflix-red-hover);
  transform: translateY(-1px);
}

.primary-btn:active {
  transform: translateY(0);
}

/* Spinner */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Alert Box */
.alert-box {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

.alert-box.error {
  background: rgba(229, 9, 20, 0.12);
  border: 1px solid rgba(229, 9, 20, 0.35);
  color: #ff6b6b;
}

.alert-box.info {
  background: rgba(0, 113, 227, 0.12);
  border: 1px solid rgba(0, 113, 227, 0.35);
  color: #70b4ff;
}

/* Results Card */
.result-card {
  background: var(--card-bg);
  border: 1px solid rgba(48, 209, 88, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(48, 209, 88, 0.1);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--card-border);
}

.status-badge {
  background: rgba(48, 209, 88, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(48, 209, 88, 0.4);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
}

.time-ago {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.device-details {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.detail-row:last-child {
  margin-bottom: 0;
}

.detail-label {
  color: var(--text-muted);
}

.detail-val {
  font-weight: 600;
  color: var(--text-main);
}

.action-section {
  text-align: center;
  margin-bottom: 1.25rem;
}

.action-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.confirm-btn {
  display: block;
  background: var(--netflix-red);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: 1.15rem;
  font-size: 1.15rem;
  font-weight: 800;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(229, 9, 20, 0.5);
}

.confirm-btn:hover {
  background: var(--netflix-red-hover);
  transform: scale(1.02);
}

.copy-link-container {
  margin-top: 0.75rem;
}

.secondary-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--card-border);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Code Badge */
.code-badge-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
}

.code-badge {
  background: rgba(229, 9, 20, 0.15);
  border: 2px solid var(--netflix-red);
  color: #fff;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 6px;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
}

.copy-badge-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-badge-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.expiry-notice {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--card-border);
}

/* FAQ */
.faq-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.faq-section h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

details {
  border-bottom: 1px solid var(--card-border);
  padding: 0.75rem 0;
}

details:last-child {
  border-bottom: none;
}

summary {
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
}

details p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* Footer */
.main-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--card-border);
}

.hidden {
  display: none !important;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .guide-card {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .service-selector {
    grid-template-columns: repeat(2, 1fr);
  }
}
