/* Custom Premium Styling for Cloudflare GeoIP Dashboard */

:root {
  --bg-dark: #0a0a16;
  --card-bg: rgba(22, 22, 38, 0.5);
  --card-border: rgba(255, 255, 255, 0.07);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --cf-orange: #f48120;
  --cf-orange-glow: rgba(244, 129, 32, 0.2);
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --success-green: #10b981;
  --glow-radius: 120px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  line-height: 1.5;
}

/* Decorative Background Glows */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.25;
  pointer-events: none;
}

.bg-glow-1 {
  width: 400px;
  height: 400px;
  background: var(--cf-orange);
  top: -100px;
  right: -50px;
}

.bg-glow-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-purple);
  bottom: -150px;
  left: -100px;
}

.bg-glow-3 {
  width: 350px;
  height: 350px;
  background: var(--accent-blue);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Container */
.container {
  width: 100%;
  max-width: 1100px;
  z-index: 1;
}

/* Header */
.app-header {
  margin-bottom: 2.5rem;
  text-align: center;
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

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

.logo-icon {
  font-size: 2.2rem;
  color: var(--cf-orange);
  filter: drop-shadow(0 0 12px var(--cf-orange));
}

.logo h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(10, 185, 129, 0.25);
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--success-green);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
  font-weight: 400;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .header-main {
    justify-content: center;
    flex-direction: column;
    text-align: center;
  }
}

/* Card Styling (Glassmorphism) */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 1.75rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6), 0 0 15px 0px rgba(244, 129, 32, 0.05);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
}

.card-icon-container {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--cf-orange);
  font-size: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.card h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Main Connection Card Specific Styles */
.main-card {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(22, 22, 38, 0.6) 0%, rgba(28, 28, 48, 0.4) 100%);
  position: relative;
}

.main-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--cf-orange), var(--accent-purple));
}

@media (max-width: 768px) {
  .main-card {
    grid-column: span 1;
  }
}

.ip-display-group {
  margin-bottom: 1.5rem;
  background: rgba(10, 10, 22, 0.4);
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.ip-display-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.ip-address-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ip-value {
  font-family: 'Fira Code', monospace;
  font-size: 1.8rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.02em;
  word-break: break-all;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.meta-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
}

.meta-item:last-child {
  border-bottom: none;
}

.meta-label {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.meta-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

.code-font {
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
}

.user-agent-text {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Geolocation Card Specific Styles */
.country-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.75rem 1rem;
  border-radius: 10px;
}

.flag-img {
  width: 42px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.country-name-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: #ffffff;
}

.grid-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.detail-tile {
  background: rgba(10, 10, 22, 0.3);
  padding: 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.tile-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tile-label i {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.tile-value {
  font-weight: 500;
  color: #ffffff;
  font-size: 0.95rem;
}

/* Info List Component (used in Network and Security cards) */
.info-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-label i {
  color: var(--text-muted);
  width: 14px;
}

.info-value {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-align: right;
}

.pop-badge {
  background: rgba(244, 129, 32, 0.1);
  border: 1px solid rgba(244, 129, 32, 0.25);
  color: var(--cf-orange);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.tls-badge {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--accent-blue);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
}

.cipher-text {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.success-text {
  color: var(--success-green);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Footer */
.app-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 1.5rem;
}

.app-footer p {
  max-width: 500px;
  margin: 0 auto;
}
