/* TeamCSB Live CC Checker - Optimized CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* CSS Variables */
:root {
  --primary: #06b6d4;
  --secondary: #8b5cf6;
  --dark-bg: #0B0F1A;
  --dark-surface: #111827;
  --dark-text: #f1f5f9;
  --dark-border: #1f2937;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--dark-bg);
  color: var(--dark-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
.header {
  background: var(--dark-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--dark-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.logo:hover {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--dark-border);
  color: var(--dark-text);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
}

.icon-btn:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100vh;
  background: var(--dark-surface);
  padding: 20px;
  z-index: 2000;
  border-right: 1px solid var(--dark-border);
  transition: left 0.3s ease;
  overflow-y: auto;
}

.sidebar.show {
  left: 0;
}

.sidebar .logo {
  font-size: 1.5rem;
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(6, 182, 212, 0.1);
  border-radius: var(--radius);
  text-align: center;
  color: var(--primary);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.searchbar {
  position: relative;
  margin-bottom: 20px;
}

.searchbar input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  color: var(--dark-text);
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.searchbar input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

.searchbar i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--dark-text);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.sidebar nav a:hover {
  background: rgba(6, 182, 212, 0.1);
  color: var(--primary);
  border-color: rgba(6, 182, 212, 0.2);
}

.sidebar nav a i {
  width: 20px;
  text-align: center;
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1500;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Main Content */
.main {
  padding: 16px;
  min-height: calc(100vh - 64px);
}

.section {
  margin: 20px auto;
  max-width: 1200px;
}

.section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 10px;
  margin: 0 0 16px;
  color: white;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-container {
  background: var(--dark-surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--dark-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.description {
  text-align: center;
  margin-bottom: 24px;
  color: rgba(241, 245, 249, 0.8);
  font-size: 14px;
}

.input-section {
  margin-bottom: 20px;
}

.input-section label {
  display: block;
  margin-bottom: 8px;
  color: var(--dark-text);
  font-weight: 600;
  font-size: 14px;
}

textarea {
  width: 100%;
  min-height: 160px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--dark-border);
  border-radius: var(--radius);
  color: var(--dark-text);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: all 0.3s ease;
}

textarea:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

textarea::placeholder {
  color: rgba(241, 245, 249, 0.4);
}

/* Controls */
.controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.btn {
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn:disabled {
  background: #64748b;
  cursor: not-allowed;
  transform: none;
  opacity: 0.7;
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.btn.danger {
  background: var(--error);
}

.btn.secondary {
  background: #6b7280;
}

/* Progress */
.progress-section {
  margin: 20px 0;
}

.progress-container {
  height: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--dark-border);
}

#progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 6px;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
}

.stat-icon.total { background: linear-gradient(135deg, #6b7280, #4b5563); }
.stat-icon.valid { background: linear-gradient(135deg, var(--success), #059669); }
.stat-icon.live { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.dead { background: linear-gradient(135deg, var(--error), #dc2626); }

.stat-info h3 {
  margin: 0 0 4px 0;
  font-size: 14px;
  color: rgba(241, 245, 249, 0.7);
  font-weight: 500;
}

.stat-info span {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark-text);
}

/* Filter Controls */
.filter-controls {
  margin: 24px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  border: 1px solid var(--dark-border);
}

.filter-controls h3 {
  color: var(--primary);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--dark-text);
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
  justify-content: center;
}

.filter-btn:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-color: transparent;
}

/* Results */
.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.result-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  padding: 20px;
  border: 2px solid var(--dark-border);
  border-left: 4px solid var(--dark-border);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--dark-border);
  transition: all 0.3s ease;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.result-card.live {
  border-left-color: var(--success);
}

.result-card.live::before {
  background: linear-gradient(90deg, var(--success), #059669);
}

.result-card.dead {
  border-left-color: var(--error);
}

.result-card.dead::before {
  background: linear-gradient(90deg, var(--error), #dc2626);
}

.result-card.invalid {
  border-left-color: #6b7280;
}

.result-card.invalid::before {
  background: linear-gradient(90deg, #6b7280, #4b5563);
}

.card-number {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 16px;
  color: var(--dark-text);
  letter-spacing: 1px;
}

.card-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.card-details span {
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: rgba(241, 245, 249, 0.8);
}

.card-type {
  background: rgba(6, 182, 212, 0.2) !important;
  color: var(--primary) !important;
  font-weight: 600;
  text-transform: uppercase;
}

.status {
  font-weight: 700;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 20px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.live .status {
  color: white;
  background: linear-gradient(135deg, var(--success), #059669);
}

.dead .status {
  color: white;
  background: linear-gradient(135deg, var(--error), #dc2626);
}

.invalid .status {
  color: white;
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

.reason {
  font-size: 12px;
  color: rgba(241, 245, 249, 0.6);
  margin-top: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border-left: 3px solid rgba(255, 255, 255, 0.2);
}

/* Footer */
.footer {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #f1f5f9;
  margin-top: 60px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.footer-section {
  display: flex;
  flex-direction: column;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.footer-logo i {
  font-size: 24px;
  color: var(--primary);
}

.footer-logo span {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.footer-description {
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 14px;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 8px;
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: rgba(6, 182, 212, 0.2);
  transform: translateY(-2px);
}

.footer-title {
  color: #f1f5f9;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  position: relative;
}

.footer-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--primary);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
}

.footer-bottom-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-bottom p {
  color: #94a3b8;
  margin: 0;
  font-size: 14px;
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-bottom-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

.footer-bottom-links a:hover {
  color: var(--primary);
}

.separator {
  color: #475569;
}

/* Light Theme */
body.light {
  --dark-bg: #f8fafc;
  --dark-surface: #ffffff;
  --dark-text: #1e293b;
  --dark-border: #e2e8f0;
}

body.light .icon-btn {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

body.light textarea {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body.light .stat-card,
body.light .filter-controls,
body.light .result-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-card {
  animation: fadeIn 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
  .main { padding: 12px; }
  .tool-container { padding: 16px; }
  .section { margin: 16px auto; }
  .controls { flex-direction: column; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { flex-direction: column; text-align: center; gap: 8px; }
  .filter-buttons { display: grid; grid-template-columns: repeat(2, 1fr); }
  .results { grid-template-columns: 1fr; }
  .footer-content { grid-template-columns: 1fr; padding: 30px 20px; }
  .footer-bottom-content { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .tool-container { margin: 8px; padding: 12px; }
  .stats { grid-template-columns: 1fr; }
  .filter-buttons { grid-template-columns: 1fr; gap: 8px; }
  .section h2 { font-size: 1rem; padding: 10px 14px; }
}