/* Dashboard Layout - Apple Style */

/* Inherits variables from main.css */

.dashboard {
  display: flex;
  min-height: 100vh;
  background-color: var(--color-surface);
  /* iOS System Gray Background */
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--color-bg);
  /* White Sidebar */
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

/* ... (keep sidebar inner styles) ... */

/* Quiet Card removed */

.sidebar-header {
  padding: 0 12px 24px;
}

.sidebar-header .logo {
  font-size: 20px;
  color: var(--color-text);
}

.sidebar nav {
  display: block !important;
  /* Force block to prevent flex alignment issues */
  width: 100%;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 0;
  margin: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  /* Essential for icon+text alignment */
  flex-direction: row;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 500;
  transition: background-color 0.2s;
  width: 100%;
  /* Ensure full width */
  text-decoration: none;
}

.sidebar-nav a:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.sidebar-nav a.active {
  background-color: rgba(0, 0, 0, 0.08);
  color: var(--color-primary);
  font-weight: 600;
}

.sidebar-nav .icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

/* Main Content */
.dashboard-main {
  flex: 1;
  margin-left: 260px;
  /* Match sidebar width */
  padding: 40px;
  max-width: 1200px;
  width: 100%;
}

/* Hero Section */
.dashboard-hero {
  margin-bottom: 40px;
}

.dashboard-hero h1 {
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.dashboard-hero p {
  color: var(--color-text-secondary);
  font-size: 17px;
}

.top-status-bar {
  display: flex;
  gap: 24px;
  margin-top: 24px;
  padding: 20px;
  background: var(--color-surface);
  border-radius: 16px;
  align-items: center;
}

.top-status-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.top-status-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  font-weight: 600;
}

.top-status-value {
  font-size: 15px;
  font-weight: 600;
}

/* Cards & Sections */
.dashboard-section {
  margin-bottom: 24px;
  /* Reduced from 40px for tighter vertical rhythm */
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
}

.card {
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.card-title {
  font-size: 17px;
  font-weight: 600;
}

/* Grid Layouts */
.content-grid {
  display: grid;
  gap: 24px;
}

.content-grid--two {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Subscription Status - Compact */
.subscription-status {
  background: #FFFFFF;
  /* Revert to white */
  color: var(--color-text);
  /* Revert to dark text */
  border: 1px solid var(--color-border);
  /* Add border */
  border-radius: 16px;
  padding: 16px 20px;
  /* Compact padding */
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  /* Add shadow */
}

.subscription-status .section-title,
.subscription-status .value {
  color: var(--color-text);
  /* Dark text */
}

.subscription-status .eyebrow,
.subscription-status label {
  color: var(--color-text-secondary);
  /* Secondary text */
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* Align center */
  margin-bottom: 12px !important;
  /* Reduced from 24px */
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
}

.subscription-status .status-header .eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px !important;
  display: block;
  opacity: 0.8;
  line-height: 1.2 !important;
}

.subscription-status .status-header .section-title {
  margin: 0 !important;
  line-height: 1.2 !important;
  font-size: 20px !important;
  padding: 0 !important;
}

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

.status-list-details {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 16px !important;
  margin-top: 12px !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid var(--color-border) !important;
}

.status-list-item {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  padding: 0 !important;
  border: none !important;
  align-items: flex-start !important;
}

.status-list-item label {
  font-size: 11px !important;
  color: var(--color-text-secondary) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.status-list-item .value {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--color-text) !important;
}

/* Compact Stripe Button Section */
.subscription-status div[style*="margin-top: 1.5rem"] {
  margin-top: 12px !important;
  padding-top: 12px !important;
  border-top: none !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.subscription-status .btn-stripe {
  width: auto !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  height: 32px !important;
}

.subscription-status p[style*="font-size: 0.875rem"] {
  margin-top: 0 !important;
  text-align: left !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  flex: 1;
}

/* Service List */
.service-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.service-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 12px;
  background: var(--color-surface);
  transition: background-color 0.2s;
}

.service-item:hover {
  background: #e5e5ea;
  /* Darker gray on hover */
}

.service-item img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.service-item span {
  font-weight: 500;
  font-size: 15px;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-actions .btn {
  flex: 1;
  justify-content: center;
}

/* Referral Box */
.referral-box {
  background: linear-gradient(135deg, #EFECE3 0%, #FFFFFF 100%);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
}

.referral-box h3 {
  font-size: 24px;
  margin-bottom: 12px;
}

.referral-code {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 24px 0;
}

.referral-code input {
  background: white;
  border: 1px solid var(--color-border);
  padding: 12px 20px;
  border-radius: 12px;
  font-family: monospace;
  font-size: 18px;
  width: 200px;
  text-align: center;
  justify-content: center;
  /* Ensure flex items are centered */
}

.referral-box p {
  text-align: center;
  /* Explicitly center the paragraph text */
  margin-left: auto;
  margin-right: auto;
  max-width: 600px;
  /* Prevent text from getting too wide */
}

/* Stripe Button */
.btn-stripe {
  background-color: #635BFF;
  /* Stripe Blurple */
  color: white;
  border: none;
}

.btn-stripe:hover {
  background-color: #5851DF;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(99, 91, 255, 0.3);
}

/* Quiet Card */
.card--quiet {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.card--quiet .card-header {
  padding-left: 0;
  padding-right: 0;
  border-bottom: 1px solid var(--color-border);
}

.card--quiet .card-body {
  padding-left: 0;
  padding-right: 0;
}

/* Stepper for Download Page */
.stepper {
  position: relative;
  padding-left: 20px;
}

.stepper::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 15px;
  width: 2px;
  background: var(--color-border);
}

.stepper-item {
  position: relative;
  padding-bottom: 40px;
  padding-left: 30px;
}

.stepper-item:last-child {
  padding-bottom: 0;
}

.step-index {
  position: absolute;
  left: -15px;
  top: 0;
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  z-index: 2;
  border: 4px solid var(--color-bg);
  /* Create gap from line */
}

.step-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-text {
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.callout {
  background: var(--color-surface);
  padding: 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-top: 12px;
  margin-bottom: 16px;
  /* Ensure gap below callout */
}

.callout--primary {
  background: rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--color-primary);
}

.callout--success {
  background: rgba(52, 199, 89, 0.1);
  border-left: 4px solid #34C759;
  color: #006020;
}

/* Form Actions Spacing */
.form-actions {
  margin-top: 16px;
}

/* Support Section */
.support-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.support-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

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

.support-item h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--color-text);
}

.support-item p {
  color: var(--color-text-secondary);
  line-height: 1.5;
  font-size: 15px;
  margin: 0;
}

.support-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* SVG Icons */
.icon-svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.sidebar-nav .icon-svg {
  color: var(--color-text-secondary);
  transition: color 0.2s;
}

.sidebar-nav a:hover .icon-svg,
.sidebar-nav a.active .icon-svg {
  color: var(--color-primary);
}

/* Redesigned Quick Links (Apple Style) */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.link-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.2s ease;
  position: relative;
}

.link-card:hover {
  background: var(--color-surface);
  transform: scale(1.01);
  border-color: var(--color-text-secondary);
}

/* Status Item Styles (Apple List Design) - Renamed to avoid conflict */
.status-list-details {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
}

.status-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

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

.status-list-item label {
  color: var(--color-text);
  font-weight: 500;
  font-size: 15px;
}

.status-list-item .value {
  color: var(--color-text-secondary);
  font-weight: 400;
  text-align: right;
}

.link-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.link-card-icon {
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.link-card p {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 4px 0 0 0;
  line-height: 1.4;
}

.link-arrow {
  color: var(--color-text-tertiary);
  transition: transform 0.2s;
}

.link-card:hover .link-arrow {
  color: var(--color-primary);
  transform: translateX(2px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.mobile-active {
    transform: translateX(0);
  }

  .dashboard-main {
    margin-left: 0;
    padding: 20px;
  }

  .status-details {
    flex-direction: column;
    gap: 20px;
  }

  .mobile-nav-toggle {
    display: block;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (min-width: 769px) {
  .mobile-nav-toggle {
    display: none;
  }
}

/* Table Styles for Payment History */
.table-container {
  overflow-x: auto;
}

.table-container table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-container th,
.table-container td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 15px;
}

.table-container th {
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg);
}

.table-container td {
  color: var(--color-text);
}

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

/* Danger Zone Redesign */
.card--danger-zone {
  border: 1px solid rgba(255, 59, 48, 0.2);
  /* Subtle red border */
  background: #FFF5F5;
  /* Very light red background */
}

.danger-zone-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.danger-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 59, 48, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.danger-icon-wrapper .icon-svg {
  width: 24px;
  height: 24px;
  color: var(--color-error);
}

.danger-text {
  flex: 1;
}

.danger-text h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.danger-text p {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0;
}

.btn-error {
  background-color: #FFF;
  color: var(--color-error);
  border: 1px solid var(--color-error);
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-error:hover {
  background-color: var(--color-error);
  color: #FFF;
}

@media (max-width: 600px) {
  .danger-zone-content {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .btn-error {
    width: 100%;
    text-align: center;
  }
}

/* Apple-style Form Row Layout */
.form-shell--list {
  display: flex;
  flex-direction: column;
}

.form-group-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

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

.form-group-row label {
  margin-bottom: 0;
  font-weight: 500;
  color: var(--color-text);
  flex-shrink: 0;
}

.form-group-row input {
  text-align: right;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  width: auto;
  flex: 1;
  margin-left: 24px;
  font-family: inherit;
  font-size: 15px;
  padding: 0;
}

.form-group-row input:disabled {
  background: transparent;
  color: var(--color-text-secondary);
  cursor: default;
  opacity: 1;
}

/* Adjust card body for list style */
.card-body--list {
  padding: 0 24px;
}
/* Pricing Controls */
.pricing-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
}

.pricing-toggle-container {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-surface);
  padding: 8px 20px;
  border-radius: 30px;
  border: 1px solid var(--color-border);
}

.toggle-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color 0.2s;
}

.toggle-label.active {
  color: var(--color-text);
  font-weight: 600;
}

/* Switch Component */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--color-primary);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--color-primary);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Duration Tabs */
.duration-tabs {
  display: flex;
  background: var(--color-surface);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.duration-tab {
  padding: 8px 24px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.duration-tab:hover {
  color: var(--color-text);
}

.duration-tab.active {
  background: #FFFFFF;
  color: var(--color-text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  font-weight: 600;
}

/* Pricing Card Updates */
.pricing-card .original-price {
  text-decoration: line-through;
  color: var(--color-text-secondary);
  font-size: 1rem;
  margin-right: 8px;
}

.pricing-card .discount-badge {
  background: #E8F5E9;
  color: #2E7D32;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}
