/* Apple-style Modern CSS */
:root {
  --primary-color: #007AFF;
  --secondary-color: #5856D6;
  --success-color: #34C759;
  --warning-color: #FF9500;
  --error-color: #FF3B30;
  --text-primary: #1D1D1F;
  --text-secondary: #86868B;
  --bg-primary: #FFFFFF;
  --bg-secondary: #F2F2F7;
  --bg-tertiary: #FAFAFA;
  --border-color: #E5E5E7;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.2s ease;
}

* {
  box-sizing: border-box;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 1rem 0;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 80px 0;
  text-align: center;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.9);
}

.features {
  padding: 80px 0;
  background: var(--bg-primary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-top: 48px;
}

.feature-card {
  text-align: center;
  padding: 32px 24px;
}

.feature-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: var(--radius-lg);
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
}

.nav-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.95);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary-color);
}

.section {
  padding: 80px 0;
}

.text-center {
  text-align: center;
}

.mb-4 {
  margin-bottom: 2rem;
}

.mt-4 {
  margin-top: 2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.stat-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.table {
  width: 100%;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.table th,
.table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

.table tbody tr:hover {
  background: var(--bg-tertiary);
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .nav-links {
    display: none;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

h1:focus {
    outline: none;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--primary-color);
}

.content {
    padding-top: 1.1rem;
    min-height: calc(100vh - 200px);
}

.valid.modified:not([type=checkbox]) {
    outline: 2px solid var(--success-color);
    border-radius: var(--radius-sm);
}

.invalid {
    outline: 2px solid var(--error-color);
    border-radius: var(--radius-sm);
}

.validation-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 4px;
}

#blazor-error-ui {
    color-scheme: light only;
    background: var(--error-color);
    bottom: 0;
    box-shadow: var(--shadow-lg);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: var(--error-color);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: var(--radius-md);
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--primary-color);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--text-primary);
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: var(--secondary-color);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--text-secondary);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Form inputs for settings page */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 16px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition);
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* Modern Homepage Styles */
.modern-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 80px 0 120px;
  position: relative;
  overflow: hidden;
}

.modern-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 40%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  transform: rotate(45deg);
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 50px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 32px;
  animation: fadeInUp 0.6s ease-out;
}

.badge-icon {
  animation: pulse 2s infinite;
}

.hero-title {
  font-size: 3.8rem;
  font-weight: 700;
  line-height: 1.1;
  color: white;
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.gradient-text {
  background: linear-gradient(135deg, #007AFF 0%, #5856D6 50%, #34C759 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
  font-weight: 700;
}

.hero-description {
  font-size: 1.3rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 40px;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  animation: fadeInUp 0.6s ease-out 0.6s both;
}

.btn-large {
  padding: 16px 32px;
  font-size: 16px;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  font-size: 18px;
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  animation: fadeInRight 0.8s ease-out 0.4s both;
}

.widget-mockup {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  padding: 0;
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 2;
  animation: float 6s ease-in-out infinite;
}

.mockup-header {
  background: var(--bg-secondary);
  padding: 16px 20px;
  border-radius: 20px 20px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.mockup-dots {
  display: flex;
  gap: 6px;
}

.mockup-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  opacity: 0.3;
}

.mockup-dots span:first-child { background: #ff5f57; opacity: 1; }
.mockup-dots span:nth-child(2) { background: #ffbd2e; opacity: 1; }
.mockup-dots span:last-child { background: #28ca42; opacity: 1; }

.mockup-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.mockup-content {
  padding: 24px 20px;
}

.mock-form-group {
  margin-bottom: 16px;
}

.mock-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.mock-form-row .mock-form-group {
  flex: 1;
  margin-bottom: 0;
}

.mock-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mock-input {
  background: var(--bg-secondary);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.mock-input.mock-active {
  background: rgba(0, 122, 255, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: 500;
}

.mock-button {
  background: var(--primary-color);
  color: white;
  text-align: center;
  padding: 14px;
  border-radius: 12px;
  font-weight: 600;
  margin-top: 20px;
  animation: pulse 2s infinite;
}

.floating-stats {
  position: absolute;
  top: -20px;
  right: -40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-bubble {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 16px 20px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  animation: bounceIn 0.8s ease-out 1s both;
}

.stat-bubble-delay {
  animation-delay: 1.3s;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Metrics Section */
.metrics-section {
  padding: 80px 0;
  background: var(--bg-primary);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
  position: relative;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.section-header p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.section-link {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.section-link:hover {
  transform: translateY(-50%) translateX(4px);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.metric-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary-color);
  transition: var(--transition);
}

.metric-card.metric-accent::before { background: var(--secondary-color); }
.metric-card.metric-success::before { background: var(--success-color); }
.metric-card.metric-info::before { background: var(--warning-color); }

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.metric-card:hover::before {
  height: 6px;
}

.metric-icon {
  font-size: 28px;
  margin-bottom: 16px;
  display: block;
}

.metric-content {
  display: flex;
  flex-direction: column;
}

.metric-number {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1;
}

.metric-label {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 12px;
}

.metric-trend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.trend-up { color: var(--success-color); font-weight: 600; }
.trend-down { color: var(--error-color); font-weight: 600; }
.trend-neutral { color: var(--text-secondary); font-weight: 500; }

.trend-text {
  color: var(--text-secondary);
  font-size: 13px;
}

/* Activity Section */
.activity-section {
  padding: 80px 0;
  background: var(--bg-secondary);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.activity-item {
  background: var(--bg-primary);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.activity-item:hover {
  background: var(--bg-tertiary);
}

.activity-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-main h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.activity-main p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.activity-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.activity-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.activity-status {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 6px;
}

.status-confirmed {
  background: rgba(52, 199, 89, 0.1);
  color: var(--success-color);
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: var(--transition);
}

.action-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Empty State */
.empty-state-section,
.loading-section {
  padding: 120px 0;
  background: var(--bg-primary);
}

.empty-state,
.loading-state {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 24px;
  animation: bounce 2s infinite;
}

.empty-state h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.6;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 48px;
}

.quick-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 48px;
}

.quick-stat {
  text-align: center;
}

.quick-stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.quick-stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  
  .hero-title {
    font-size: 2.8rem;
  }
  
  .hero-description {
    font-size: 1.1rem;
  }
  
  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .floating-stats {
    position: static;
    flex-direction: row;
    justify-content: center;
    margin-top: 24px;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .activity-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .activity-meta {
    align-items: flex-start;
  }
  
  .empty-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .quick-stats {
    gap: 24px;
  }
  
  .section-link {
    position: static;
    transform: none;
    display: inline-block;
    margin-top: 16px;
  }
}