@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-color: #0b0914;
  --bg-gradient: radial-gradient(circle at 50% 30%, #17152d 0%, #0b0914 100%);
  --panel-bg: rgba(255, 255, 255, 0.03);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-glow: rgba(124, 77, 255, 0.2);
  --text-primary: #f3f1f9;
  --text-secondary: #9f9baa;
  --accent-purple: #7c4dff;
  --accent-purple-glow: rgba(124, 77, 255, 0.6);
  --accent-cyan: #00f5ff;
  --accent-cyan-glow: rgba(0, 245, 255, 0.6);
  --success: #00ff87;
  --error: #ff4d4d;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1rem;
  overflow-x: hidden;
}

header {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: fadeInDown 0.8s ease-out;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-cyan) 70%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

p.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 2.5rem;
  width: 100%;
  max-width: 680px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  transition: border 0.3s ease, box-shadow 0.3s ease;
  animation: fadeInUp 0.8s ease-out;
}

.glass-panel:hover {
  border-color: rgba(124, 77, 255, 0.25);
  box-shadow: 0 20px 60px rgba(124, 77, 255, 0.08);
}

/* Sub-panels */
.sub-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.input-container {
  position: relative;
}

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-family);
  transition: all 0.3s ease;
}

input[type="text"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 12px var(--panel-border-glow);
  background: rgba(0, 0, 0, 0.4);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  border: none;
  width: 100%;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple) 0%, #6200ea 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 77, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 77, 255, 0.5);
  background: linear-gradient(135deg, #8c5dff 0%, #7000ff 100%);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--panel-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Copy Link Results Panel */
.result-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed rgba(124, 77, 255, 0.4);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 2rem;
  text-align: left;
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
}

.copy-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: var(--accent-cyan);
  font-family: monospace;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy-small {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  background: rgba(124, 77, 255, 0.15);
  color: var(--text-primary);
  border: 1px solid rgba(124, 77, 255, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-copy-small:hover {
  background: rgba(124, 77, 255, 0.3);
  box-shadow: 0 0 10px rgba(124, 77, 255, 0.2);
}

/* Circular Data Meter */
.meter-section {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.circular-meter {
  position: relative;
  width: 160px;
  height: 160px;
}

.circular-meter svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.circular-meter circle {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}

.circular-meter .bg-circle {
  stroke: rgba(255, 255, 255, 0.05);
}

.circular-meter .progress-circle {
  stroke: url(#meterGrad);
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.meter-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.meter-percent {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.meter-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.stats-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  min-width: 240px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.stat-item span:first-child {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.stat-item span:last-child {
  font-weight: 600;
  color: var(--text-primary);
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-active {
  background: rgba(0, 255, 135, 0.15);
  color: var(--success);
  border: 1px solid rgba(0, 255, 135, 0.3);
}

/* QR Code Section */
.qr-section {
  text-align: center;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-container {
  background: #fff;
  padding: 1.25rem;
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(124, 77, 255, 0.2);
  display: inline-block;
  margin-bottom: 1rem;
  position: relative;
  transition: transform 0.3s ease;
}

.qr-container:hover {
  transform: scale(1.03);
}

.qr-container canvas, .qr-container img {
  display: block;
  width: 180px;
  height: 180px;
}

.activation-code-box {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
  text-align: left;
}

.activation-code-box code {
  display: block;
  word-break: break-all;
  font-family: monospace;
  color: var(--accent-cyan);
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  max-height: 80px;
  overflow-y: auto;
}

/* Tabs for Device Instructions */
.tabs-container {
  margin-top: 2rem;
}

.tabs-nav {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.25rem;
  gap: 1.5rem;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 0.25rem;
  cursor: pointer;
  position: relative;
  transition: color 0.3s ease;
}

.tab-btn.active {
  color: var(--accent-cyan);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan-glow);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease-in-out;
}

.tab-panel.active {
  display: block;
}

.tab-panel ol {
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.tab-panel li {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.tab-panel li strong {
  color: var(--text-primary);
}

/* Country Grid Section */
.countries-section {
  margin-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 2rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: #fff;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.countries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}

.country-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.country-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(124, 77, 255, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(124, 77, 255, 0.05);
}

.country-flag {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.country-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.country-code {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 700;
  margin-top: 2px;
  text-transform: uppercase;
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Password Screen Styles */
.password-box {
  text-align: center;
}

.password-box h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.password-box p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.error-message {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  display: none;
}

/* Footer styling */
footer {
  margin-top: auto;
  padding-top: 3rem;
  padding-bottom: 1rem;
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  text-align: center;
}

/* Responsiveness adjustments */
@media (max-width: 600px) {
  .glass-panel {
    padding: 1.5rem;
  }
  
  .meter-section {
    flex-direction: column;
    align-items: center;
  }
}
