/* =============================================================================
   iKUB SaaS Platform - Core Stylesheet
   Brand: CPC Technology
   Aesthetic: Dark Blue / Cyan / Green Glassmorphism SaaS
   ============================================================================= */

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

:root {
  /* Color Palette */
  --bg-dark: #070b12;
  --bg-main: #0b111e;
  --bg-surface: #101a2d;
  --bg-card: rgba(18, 28, 47, 0.72);
  --bg-card-hover: rgba(24, 38, 64, 0.85);
  --bg-glass: rgba(16, 26, 45, 0.65);
  
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(6, 182, 212, 0.35);

  /* Brand Accents */
  --primary: #06b6d4; /* Cyan */
  --primary-hover: #0891b2;
  --accent-green: #10b981; /* Green */
  --accent-green-hover: #059669;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #10b981 100%);
  --grad-cyan-green: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
  --grad-blue-dark: linear-gradient(180deg, #101a2d 0%, #0b111e 100%);
  --grad-card: linear-gradient(145deg, rgba(22, 36, 61, 0.6) 0%, rgba(13, 22, 38, 0.8) 100%);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-sans);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Shadows & Glow */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
  --glow-cyan: 0 0 24px rgba(6, 182, 212, 0.3);
  --glow-green: 0 0 24px rgba(16, 185, 129, 0.3);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --trans-fast: 0.15s ease;
  --trans-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 2.25rem; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; letter-spacing: -0.015em; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p {
  color: var(--text-muted);
  font-size: 0.975rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--trans-fast);
}

a:hover {
  color: #38bdf8;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-wide {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.page-wrapper {
  flex: 1;
  padding: 2rem 0 4rem;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  transition: transform var(--trans-normal), box-shadow var(--trans-normal), border-color var(--trans-normal);
}

.glass-card:hover {
  border-color: var(--border-light);
}

.glass-card.interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  border-color: var(--border-accent);
}

/* Header & Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 17, 30, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0.85rem 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--grad-cyan-green);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-cyan);
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
}

.brand-tag {
  font-size: 0.65rem;
  background: rgba(6, 182, 212, 0.15);
  color: var(--primary);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 0.35rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--trans-fast);
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  border-radius: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.925rem;
  font-weight: 600;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--trans-normal);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--grad-cyan-green);
  color: #06111f;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
  color: #040d18;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: var(--border-light);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: rgba(6, 182, 212, 0.1);
  color: #fff;
}

.btn-success {
  background: var(--accent-green);
  color: #022013;
  font-weight: 700;
}

.btn-success:hover {
  background: var(--accent-green-hover);
  color: #fff;
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: var(--accent-rose);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.825rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.85rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.form-hint {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  background: rgba(13, 20, 34, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  transition: all var(--trans-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18);
  background: rgba(17, 26, 44, 0.95);
}

.form-control::placeholder {
  color: var(--text-dim);
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

/* Stat Grid & Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-cyan-green);
  opacity: 0.7;
}

.stat-card.revenue::after {
  background: linear-gradient(90deg, #10b981, #06b6d4);
}

.stat-card.community::after {
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

.stat-card.alert::after {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.stat-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: #fff;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-primary {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid var(--border-glass);
}

/* Rotation Progress List */
.rotation-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.rotation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(13, 22, 38, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: all var(--trans-fast);
}

.rotation-item.current {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.rotation-item.completed {
  opacity: 0.75;
}

.rotation-member {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.rotation-pos {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  font-family: var(--font-heading);
}

.rotation-item.current .rotation-pos {
  background: var(--primary);
  color: #06111f;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  background: var(--bg-card);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  padding: 0.85rem 1.15rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(11, 18, 32, 0.7);
  border-bottom: 1px solid var(--border-glass);
}

.table td {
  padding: 0.95rem 1.15rem;
  font-size: 0.9rem;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Alert Boxes */
.alert {
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.925rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.alert-danger {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
}

.alert-info {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #38bdf8;
}

/* Plans Grid */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: all var(--trans-normal);
}

.plan-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.25);
  transform: scale(1.02);
}

.plan-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
}

.plan-badge {
  position: absolute;
  top: -12px;
  right: 24px;
  background: var(--grad-cyan-green);
  color: #06111f;
  font-size: 0.725rem;
  font-weight: 800;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.plan-price {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: #fff;
  margin: 1rem 0 1.5rem;
}

.plan-price span {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 400;
}

.plan-features {
  list-style: none;
  margin-bottom: 2rem;
  flex: 1;
}

.plan-features li {
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.plan-features li::before {
  content: '✓';
  color: var(--accent-green);
  font-weight: 900;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-window {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  max-width: 540px;
  width: 100%;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Digital Receipt Card (Print Friendly) */
.receipt-wrapper {
  max-width: 580px;
  margin: 2rem auto;
  background: #ffffff;
  color: #0f172a;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.receipt-header {
  text-align: center;
  border-bottom: 2px dashed #cbd5e1;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.95rem;
}

.receipt-total {
  border-top: 2px solid #0f172a;
  margin-top: 1rem;
  padding-top: 1rem;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
}

@media print {
  body { background: #fff !important; color: #000 !important; }
  .navbar, .footer, .btn, .no-print { display: none !important; }
  .receipt-wrapper { box-shadow: none !important; margin: 0 !important; max-width: 100% !important; }
}

/* Responsive Mobile Navigation Drawer */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .mobile-nav-toggle {
    display: block;
  }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-glass);
    flex-direction: column;
    padding: 1.25rem;
    gap: 0.5rem;
  }
  .nav-menu.open {
    display: flex;
  }
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.45rem; }
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  color: #fff;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Pulsing Badge for Active/Live indicators */
.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.7);
  animation: pulse 1.8s infinite;
  display: inline-block;
}

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