:root {
  --bg-dark: #030610;
  --bg-card: rgba(18, 25, 40, 0.7);
  --bg-card-hover: rgba(25, 35, 55, 0.8);
  --accent-primary: #3b82f6;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --glow: 0 0 20px rgba(59, 130, 246, 0.3);
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Animation */
.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 40%);
  filter: blur(40px);
  animation: bg-pulse 10s ease-in-out infinite alternate;
}

@keyframes bg-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.1); opacity: 1; }
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 2rem;
}

.logo {
  font-weight: 800;
  font-size: 1.5rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.main-container {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

@media (max-width: 900px) {
  .main-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
}

.hero-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-title {
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 480px;
}

@media (max-width: 900px) {
  .hero-desc {
    margin: 0 auto;
  }
}

/* Card Styles */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--glass-border);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6), var(--glow);
  border-color: rgba(255, 255, 255, 0.15);
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Dropzone */
.dropzone {
  position: relative;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 3rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.05);
  transform: translateY(-2px);
}

.dropzone-content {
  z-index: 1;
}

.drop-icon-wrapper {
  display: inline-flex;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  margin-bottom: 1rem;
  color: var(--accent-primary);
}

.drop-text {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.drop-subtext {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Pills */
.upload-info {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.info-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Buttons */
.actions {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: inherit;
  text-decoration: none;
}

.full-width {
    width: 100%;
}

.glass-form {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-section h4 {
  color: var(--text-color);
  opacity: 0.7;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.input-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.unit-input {
  display: flex;
  gap: 0.5rem;
}

.unit-input input {
  flex: 2;
}

.unit-input select {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0 1rem;
  cursor: pointer;
}

.label-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  display: block;
}

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.checkbox-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  align-items: center;
}

.checkbox-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.checkbox-card input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
}

.cb-content {
  display: flex;
  flex-direction: column;
}

.cb-title {
  font-weight: 500;
  font-size: 0.9rem;
}

.cb-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.checkbox-card.danger:hover {
  background: rgba(255, 50, 50, 0.1);
  border-color: rgba(255, 50, 50, 0.2);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.select-wrapper {
  position: relative;
}

.select-wrapper select {
  width: 100%;
  appearance: none;
  background: rgba(0,0,0,0.2);
  color: inherit;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.75rem 1rem;
  border-radius: 8px;
}

.primary-btn {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

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

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

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Status & Progress */
.status {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  min-height: 1.4em;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.progress-bar-wrapper {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent-gradient);
  width: 0%;
  transition: width 0.2s ease;
  border-radius: 100px;
}

.progress-text {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  width: 3ch;
}

/* Preview */
.preview-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 1rem;
}

.preview-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
}

.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preview-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--accent-primary);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.preview-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Results */
.results-card {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.results-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.success-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.link-group {
  margin-bottom: 1.5rem;
}

.input-wrapper {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 4px;
}

.input-wrapper a {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 0.75rem;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.scan-status {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  border-radius: 12px;
}

.qr-container img {
  width: 140px;
  height: 140px;
  border-radius: 8px;
  background: white;
  padding: 8px;
}

.qr-container p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer {
  margin-top: auto;
  text-align: center;
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
  padding-top: 2rem;
}

@media (max-width: 600px) {
  .page { padding: 1.5rem; }
  .hero-title { font-size: 2.5rem; }
  .actions { grid-template-columns: 1fr; }
  .card { padding: 1.5rem; }
}

/* Admin Styles */
.admin-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.subcard {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.5rem;
}

.filter-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Admin & Modal Styles Restored */
.admin-create {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.admin-section-title {
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.5rem;
}

.admin-grid-inputs {
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.admin-create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  align-items: center;
}

.permissions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.pill-toggle input {
  accent-color: var(--accent-primary);
  width: 16px;
  height: 16px;
}

body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 999;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 16, 32, 0.7);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  background: rgba(15, 26, 50, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  width: min(480px, 100%);
  z-index: 1;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ghost-button {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: border 0.2s ease, color 0.2s ease;
}

.ghost-button:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Tab and Table styles for admin panel */
.tab-controls {
  display: inline-flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 6px;
  margin-top: 16px;
}

.tab-button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.tab-button.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.tab-panels {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-main);
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.8rem;
}

input[type='text'],
input[type='password'],
input[type='date'],
input[type='number'],
input[type='datetime-local'] {
  background: #0b1220;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  color: var(--text-main);
}

/* Pricing Page Styles */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    width: 100%;
}

.pricing-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    border: 1px solid var(--border-color);
}

.pricing-card.popular {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
}

.pricing-card.featured-card-border {
    border-color: var(--border-color); /* Fallback */
    border-top: 4px solid var(--border-color);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #8b5cf6;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.4);
}

.plan-header {
    text-align: center;
    margin-bottom: 2rem;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
}

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

.plan-desc {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.plan-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-main);
    font-size: 0.95rem;
}

.check-icon {
    color: #10b981;
    font-weight: bold;
}

/* Custom Builder */
.custom-plan-section {
    width: 100%;
}

.custom-header {
    text-align: center;
    margin-bottom: 2rem;
}

.custom-builder-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
}

@media (max-width: 800px) {
    .custom-builder-grid {
        grid-template-columns: 1fr;
    }
}

.sliders-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.control-group {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.control-header label {
    font-weight: 600;
}

.value-display {
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--accent-primary);
}

.slider {
    width: 100%;
    margin: 1rem 0;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    border: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.control-note {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: right;
}

.summary-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-card h3 {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.total-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.total-price {
    font-size: 2rem;
    font-weight: 800;
    color: #10b981;
}
