/* Apple-inspired Dashboard Styles */
:root {
  --apple-primary: #0071e3;
  --apple-primary-dark: #0051a2;
  --apple-secondary: #8e8e93;
  --apple-bg: #f5f5f7;
  --apple-card-bg: #ffffff;
  --apple-text: #1d1d1f;
  --apple-border: #d2d2d7;
  --apple-success: #34c759;
  --apple-warning: #ff9500;
  --apple-danger: #ff3b30;
  --apple-info: #5ac8fa;
  --apple-inactive: #8e8e93;
  --apple-card-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  --apple-card-radius: 10px;
  --apple-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  font-family: var(--apple-font);
  background-color: var(--apple-bg);
  color: var(--apple-text);
  line-height: 1.5;
  padding-bottom: 80px;
  margin: 0;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
}

h1 {
  font-size: 28px;
  margin-bottom: 24px;
}

h2 {
  font-size: 22px;
  margin-bottom: 20px;
}

h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

.text-muted {
  color: var(--apple-secondary) !important;
}

/* Navbar */
.navbar-apple {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--apple-border);
  padding: 15px 0;
}

.navbar-brand {
  font-weight: 600;
  font-size: 20px;
  color: var(--apple-text);
}

/* Cards */
.apple-card {
  background-color: var(--apple-card-bg);
  border-radius: var(--apple-card-radius);
  box-shadow: var(--apple-card-shadow);
  border: none;
  padding: 20px;
  margin-bottom: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.apple-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
}

.card-subtitle {
  color: var(--apple-secondary);
  font-size: 14px;
  margin-bottom: 15px;
}

/* Buttons */
.btn-apple-primary {
  background-color: var(--apple-primary);
  color: white;
  border: none;
  border-radius: 24px;
  padding: 8px 20px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-apple-primary:hover, .btn-apple-primary:focus {
  background-color: var(--apple-primary-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.3);
}

.btn-apple-secondary {
  background-color: #e8e8ed;
  color: var(--apple-text);
  border: none;
  border-radius: 24px;
  padding: 8px 20px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-apple-secondary:hover, .btn-apple-secondary:focus {
  background-color: #d1d1d6;
  color: var(--apple-text);
  transform: translateY(-1px);
}

/* Forms */
.form-control {
  border-radius: 8px;
  border: 1px solid var(--apple-border);
  padding: 12px 15px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--apple-primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.25);
}

.form-label {
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 14px;
}

/* Status Badges */
.badge-active {
  background-color: var(--apple-success);
  color: white;
  border-radius: 12px;
  padding: 4px 12px;
  font-weight: 500;
  font-size: 12px;
}

.badge-trial {
  background-color: var(--apple-info);
  color: white;
  border-radius: 12px;
  padding: 4px 12px;
  font-weight: 500;
  font-size: 12px;
}

.badge-inactive {
  background-color: var(--apple-secondary);
  color: white;
  border-radius: 12px;
  padding: 4px 12px;
  font-weight: 500;
  font-size: 12px;
}

.badge-expired {
  background-color: var(--apple-danger);
  color: white;
  border-radius: 12px;
  padding: 4px 12px;
  font-weight: 500;
  font-size: 12px;
}

/* Tabs */
.apple-tabs {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--apple-border);
  display: flex;
  overflow-x: auto;
  padding-bottom: 0;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.apple-tabs::-webkit-scrollbar {
  display: none;
}

.apple-tabs .nav-link {
  color: var(--apple-secondary);
  padding: 12px 20px;
  border: none;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  margin-right: 8px;
  position: relative;
  background: transparent;
  transition: all 0.2s ease;
}

.apple-tabs .nav-link.active {
  color: var(--apple-primary);
  border-bottom: 2px solid var(--apple-primary);
  background: transparent;
}

.apple-tabs .nav-link:hover {
  color: var(--apple-primary);
}

.apple-tabs .nav-link .icon {
  margin-right: 8px;
  vertical-align: middle;
}

/* Tables */
.apple-table {
  width: 100%;
  margin-bottom: 20px;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--apple-card-radius);
  overflow: hidden;
  background: white;
  box-shadow: var(--apple-card-shadow);
}

.apple-table thead {
  background-color: #f5f5f7;
}

.apple-table th {
  padding: 15px 20px;
  font-weight: 600;
  text-align: left;
  font-size: 14px;
  color: var(--apple-secondary);
  border-bottom: 1px solid var(--apple-border);
}

.apple-table td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--apple-border);
  font-size: 14px;
  vertical-align: middle;
}

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

.apple-table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.01);
}

/* Charts */
.chart-container {
  padding: 20px;
  position: relative;
  height: 350px;
}

/* Stats Cards */
.stat-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
  border-radius: var(--apple-card-radius);
  box-shadow: var(--apple-card-shadow);
  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card-icon {
  font-size: 30px;
  margin-bottom: 15px;
  background: white;
  width: 60px;
  height: 60px;
  line-height: 60px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-card-value {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--apple-text);
}

.stat-card-title {
  font-size: 14px;
  color: var(--apple-secondary);
  font-weight: 500;
}

/* Search Bar */
.search-container {
  position: relative;
  margin-bottom: 30px;
}

.search-input {
  border-radius: 20px;
  padding-left: 40px;
  background-color: var(--apple-card-bg);
  border: 1px solid var(--apple-border);
  height: 45px;
  width: 100%;
  transition: all 0.3s ease;
}

.search-input:focus {
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.25);
  border-color: var(--apple-primary);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 14px;
  color: var(--apple-secondary);
}

/* Animations */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

/* Responsive */
@media (max-width: 768px) {
  .apple-tabs {
    justify-content: flex-start;
  }
  
  .apple-card {
    padding: 15px;
  }
  
  .chart-container {
    height: 250px;
  }
}

/* License Key Display */
.license-key {
  font-family: monospace;
  background-color: #f5f5f7;
  padding: 10px 15px;
  border-radius: 5px;
  letter-spacing: 1px;
}

/* Status Indicators */
.status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-active {
  background-color: var(--apple-success);
}

.status-trial {
  background-color: var(--apple-info);
}

.status-inactive {
  background-color: var(--apple-secondary);
}

.status-expired {
  background-color: var(--apple-danger);
}

/* Footer */
.footer {
  padding: 20px 0;
  background-color: var(--apple-card-bg);
  border-top: 1px solid var(--apple-border);
  text-align: center;
  font-size: 13px;
  color: var(--apple-secondary);
}

/* Health Status */
.health-status {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.health-good {
  background-color: rgba(52, 199, 89, 0.2);
  color: var(--apple-success);
}

.health-warning {
  background-color: rgba(255, 149, 0, 0.2);
  color: var(--apple-warning);
}

.health-error {
  background-color: rgba(255, 59, 48, 0.2);
  color: var(--apple-danger);
}

/* Metrics Visualization */
.metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(0, 113, 227, 0.1);
  margin-bottom: 15px;
}

.text-apple-primary {
  color: var(--apple-primary);
}

.text-apple-success {
  color: var(--apple-success);
}

.text-apple-warning {
  color: var(--apple-warning);
}

.text-apple-danger {
  color: var(--apple-danger);
}

.metric-value {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 5px;
}

.metric-trend {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-top: 10px;
}

.metric-trend.up {
  background-color: rgba(52, 199, 89, 0.1);
  color: var(--apple-success);
}

.metric-trend.down {
  background-color: rgba(255, 59, 48, 0.1);
  color: var(--apple-danger);
}

/* Analytics Time Filter */
.time-filter {
  font-size: 13px;
  font-weight: 500;
}

.time-filter.active {
  background-color: var(--apple-primary);
  color: white;
}

/* Chart Tooltips */
.chart-tooltip {
  background-color: rgba(29, 29, 31, 0.9);
  border-radius: 8px;
  color: white;
  padding: 10px;
  font-size: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.chart-tooltip-title {
  font-weight: 600;
  margin-bottom: 5px;
}

.chart-tooltip-value {
  font-size: 14px;
  font-weight: 500;
}

.chart-tooltip-label {
  font-size: 11px;
  opacity: 0.7;
}

/* Tooltips */
.apple-tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.apple-tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: var(--apple-text);
  color: white;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
  pointer-events: none;
}

.apple-tooltip:hover .apple-tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Sidebar */
.sidebar {
  background: linear-gradient(to bottom, #f2f2f7, #e5e5ea);
  border-right: 1px solid var(--apple-border);
  min-height: 100vh;
  padding: 30px 15px;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.05);
}

.sidebar-link {
  display: block;
  padding: 14px 16px;
  color: #1d1d1f;
  border-radius: 10px;
  margin-bottom: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.sidebar-link:hover {
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--apple-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.sidebar-link.active {
  background-color: #0071e3;
  color: white;
  box-shadow: 0 5px 15px rgba(0, 113, 227, 0.3);
}

.sidebar-link i {
  margin-right: 10px;
}

/* Top Cards */
.top-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.top-card-header {
  font-size: 15px;
  color: var(--apple-secondary);
  margin-bottom: 10px;
  font-weight: 500;
}

.top-card-content {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 10px;
}

.top-card-footer {
  font-size: 13px;
  color: var(--apple-secondary);
}

.trend-up {
  color: var(--apple-success);
}

.trend-down {
  color: var(--apple-danger);
}

/* Loading Spinner */
.apple-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(0, 113, 227, 0.1);
  border-top-color: var(--apple-primary);
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Date Range Picker */
.date-range-picker {
  display: inline-flex;
  background-color: #e0e0e5;
  border-radius: 24px;
  padding: 5px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.date-range-option {
  border: none;
  background-color: #f5f5f7;
  color: #333;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
  margin: 0 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.date-range-option:hover {
  background-color: #d8e1f3;
  transform: translateY(-1px);
}

.date-range-option.active {
  background-color: var(--apple-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
}

/* Detail View */
.detail-row {
  display: flex;
  margin-bottom: 15px;
  border-bottom: 1px solid #f5f5f7;
  padding-bottom: 15px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  width: 35%;
  color: var(--apple-secondary);
  font-weight: 500;
  font-size: 14px;
}

.detail-value {
  width: 65%;
  font-size: 14px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 10px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f7;
  color: var(--apple-secondary);
  border: none;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background-color: var(--apple-primary);
  color: white;
}

/* Create New Button */
.btn-create-new {
  display: inline-flex;
  align-items: center;
  background-color: var(--apple-primary);
  color: white;
  border-radius: 24px;
  padding: 10px 20px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
}

.btn-create-new:hover {
  background-color: var(--apple-primary-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(0, 113, 227, 0.3);
}

.btn-create-new .icon {
  margin-right: 8px;
}

/* Custom Switch */
.apple-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.apple-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.apple-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e4e4e4;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 34px;
}

.apple-switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

input:checked + .apple-switch-slider {
  background-color: var(--apple-success);
}

input:checked + .apple-switch-slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-state-icon {
  font-size: 64px;
  color: var(--apple-secondary);
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state-text {
  color: var(--apple-secondary);
  font-size: 18px;
  margin-bottom: 20px;
  max-width: 400px;
}

/* Modal */
.apple-modal {
  border-radius: var(--apple-card-radius);
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  border: none;
}

.apple-modal-header {
  border-bottom: 1px solid var(--apple-border);
  padding: 20px;
}

.apple-modal-title {
  font-size: 18px;
  font-weight: 600;
}

.apple-modal-body {
  padding: 20px;
}

.apple-modal-footer {
  border-top: 1px solid var(--apple-border);
  padding: 15px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-close {
  opacity: 0.6;
  font-size: 12px;
}

.btn-close:hover {
  opacity: 1;
}

/* Enhanced Apple Design Elements */
/* Glassmorphism effects */
.glassmorphism {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Improved card interactions */
.apple-card {
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.apple-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
}

/* Enhanced sidebar */
.sidebar {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(250, 250, 252, 0.8));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid rgba(0, 0, 0, 0.05);
}

/* Improved navbar */
.navbar-apple {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  z-index: 1000;
}

/* Softer shadows */
.soft-shadow {
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
}

/* Enhanced buttons */
.btn-apple-primary, .btn-apple-secondary {
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-apple-primary:active, .btn-apple-secondary:active {
  transform: scale(0.96);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --apple-bg: #1a1a1a;
    --apple-card-bg: #2c2c2c;
    --apple-text: #f5f5f7;
    --apple-border: #434343;
    --apple-secondary: #ababab;
  }
  
  .apple-card, .sidebar, .navbar-apple {
    background-color: rgba(44, 44, 44, 0.8);
  }
  
  .navbar-apple {
    border-bottom: 1px solid #434343;
  }
  
  .btn-apple-secondary {
    background-color: #3a3a3a;
    color: #f5f5f7;
  }
  
  .apple-table thead {
    background-color: #383838;
  }
  
  input, select, textarea {
    background-color: #383838;
    color: #f5f5f7;
    border-color: #434343;
  }
}

/* Landing Page Specific Styles */
.hero {
  background: linear-gradient(135deg, var(--apple-primary), var(--apple-primary-dark));
  color: white;
  padding: 5rem 0;
  border-radius: 0 0 50% 50% / 20px;
}

.feature-icon {
  font-size: 3rem;
  color: var(--apple-primary);
  margin-bottom: 1rem;
}

.feature-card {
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-10px);
}

.cta-section {
  background-color: var(--apple-bg);
  padding: 4rem 0;
}

.screenshot {
  border-radius: 8px;
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
  max-width: 100%;
}

.navbar-landing {
  background-color: transparent;
  transition: background-color 0.3s ease;
}

.navbar-landing.scrolled {
  background-color: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-landing .navbar-brand {
  font-weight: 700;
  color: white;
}

.navbar-landing.scrolled .navbar-brand,
.navbar-landing.scrolled .nav-link {
  color: var(--apple-text);
}

.navbar-landing .nav-link {
  color: white;
  font-weight: 500;
  margin: 0 10px;
}

.pricing-card {
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.pricing-card:hover {
  transform: translateY(-10px);
}

.pricing-card.featured {
  border: 2px solid var(--apple-primary);
  transform: scale(1.05);
}

.pricing-card.featured:hover {
  transform: scale(1.05) translateY(-10px);
}

.badge-feature {
  background-color: rgba(0, 113, 227, 0.1);
  color: var(--apple-primary);
  border-radius: 20px;
  padding: 5px 15px;
  font-weight: 500;
}