/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
}

nav {
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

nav > div {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

nav span {
  font-weight: 500;
  color: #333;
}

.notice, .alert {
  padding: 1rem;
  margin: 1rem 2rem;
  border-radius: 4px;
}

.notice {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.dashboard-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.dashboard-container h1 {
  color: #333;
  margin-bottom: 1.5rem;
}

/* Tabs */
.tabs {
  margin-top: 2rem;
}

.tabs-list {
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 2rem;
  gap: 0;
}

.tab-button {
  background: none;
  border: none;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  top: 2px;
  font-family: inherit;
}

.tab-button:hover {
  color: #333;
  background-color: #f8f9fa;
}

.tab-button.active {
  color: #4a90e2;
  border-bottom-color: #4a90e2;
  font-weight: 600;
}

.tab-button:focus {
  outline: 2px solid #4a90e2;
  outline-offset: 2px;
}

.tabs-panels {
  position: relative;
}

.tab-panel {
  display: block;
}

.tab-panel.hidden {
  display: none;
}

.dashboard-welcome {
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.dashboard-welcome ul {
  margin: 1rem 0;
  padding-left: 2rem;
}

.dashboard-welcome li {
  margin: 0.5rem 0;
}

.metrics-grid {
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Snapshot info */
.snapshot-info {
  margin-bottom: 1.5rem;
  color: #666;
  font-size: 0.9rem;
}

/* Metrics summary cards */
.metrics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #4a90e2;
  transition: transform 0.2s, box-shadow 0.2s;
}

.metric-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.metric-text {
  flex: 1;
  min-width: 0;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.metric-card.primary {
  border-left-color: #28a745;
}

.metric-card.warning {
  border-left-color: #ffc107;
}

.metric-label {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  line-height: 1.2;
}

.metric-currency {
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.25rem;
}

.metric-subtext {
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.5rem;
}

/* Plan type summary section */
.plan-type-summary {
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.plan-type-summary h2 {
  color: #333;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.plan-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

/* Daily metrics grid - force 3 columns */
.daily-metrics-grid {
  grid-template-columns: repeat(3, 1fr);
}

.plan-type-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s, box-shadow 0.2s;
  color: #fff;
}

.plan-type-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.plan-type-card:nth-child(1) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.plan-type-card:nth-child(2) {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.plan-type-card:nth-child(3) {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.plan-type-card:nth-child(4) {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.plan-type-card:nth-child(5) {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.plan-type-card:nth-child(6) {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.plan-type-card:nth-child(n+7) {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  color: #333;
}

.plan-type-name {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.plan-type-mrr {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.plan-type-count {
  font-size: 0.875rem;
  opacity: 0.85;
  font-weight: 500;
}

/* Marketplace-specific styles - count is large, MRR is small */
.marketplace-card .plan-type-count {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  opacity: 1;
}

.marketplace-card .plan-type-mrr {
  font-size: 0.875rem;
  opacity: 0.85;
  font-weight: 500;
  margin-bottom: 0;
}

/* Total box styling - make it stand out */
.marketplace-total {
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
}

/* Plan breakdown section */
.plan-breakdown {
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.plan-breakdown h2 {
  color: #333;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.table-container {
  overflow-x: auto;
}

.metrics-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.metrics-table thead {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

.metrics-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #333;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metrics-table th.text-right {
  text-align: right;
}

.metrics-table tbody tr {
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.15s;
}

.metrics-table tbody tr:hover {
  background-color: #f8f9fa;
}

.metrics-table td {
  padding: 1rem;
  color: #333;
}

.metrics-table td.text-right {
  text-align: right;
}

.metrics-table tfoot {
  background-color: #f8f9fa;
  border-top: 2px solid #dee2e6;
}

.metrics-table tfoot .total-row td {
  font-weight: 700;
  padding: 1rem;
}

.currency-badge {
  display: inline-block;
  font-size: 0.75rem;
  background-color: #e9ecef;
  color: #666;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  font-weight: 500;
}

/* No data state */
.no-data {
  background-color: #fff;
  padding: 3rem 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
  color: #666;
}

.no-data p {
  margin: 0;
  font-size: 1rem;
}

/* Code Redemption Summary */
.code-redemption-summary {
  background-color: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.code-redemption-summary h2 {
  color: #333;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.code-redemption-card {
  border-left-color: #9c27b0;
}

.metric-change {
  font-size: 0.875rem;
  margin-top: 0.75rem;
  font-weight: 500;
}

.metric-change.positive {
  color: #28a745;
}

.metric-change.negative {
  color: #dc3545;
}

.metric-change.neutral {
  color: #666;
}

.sparkline-container {
  flex-shrink: 0;
  width: 120px;
  height: 40px;
  background-color: #f8f9fa;
  border-radius: 4px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.sparkline-container canvas {
  max-width: 100%;
  max-height: 100%;
  width: 100% !important;
  height: 100% !important;
}

.sparkline-container > div {
  width: 100% !important;
  height: 100% !important;
  overflow: hidden;
}

.sparkline-container svg {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
}

.sparkline-chart-container {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 4px;
}

/* Login form styles */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 200px);
  padding: 2rem;
}

.login-card {
  background-color: #fff;
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

.login-card h2 {
  color: #333;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  font-weight: 600;
  text-align: center;
}

.login-card .field {
  margin-bottom: 1.5rem;
}

.login-card label {
  display: block;
  margin-bottom: 0.5rem;
  color: #333;
  font-weight: 500;
  font-size: 0.875rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: #4a90e2;
}

.checkbox-label {
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  font-family: inherit;
  width: 100%;
}

.btn-primary {
  background-color: #4a90e2;
  color: #fff;
}

.btn-primary:hover {
  background-color: #357abd;
}

.btn-primary:active {
  transform: translateY(1px);
}

.login-links {
  margin-top: 1.5rem;
  text-align: center;
}

.forgot-password-link {
  color: #4a90e2;
  text-decoration: none;
  font-size: 0.875rem;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

.login-card .alert {
  margin-bottom: 1.5rem;
}

.login-card .alert ul {
  margin: 0;
  padding-left: 1.5rem;
}

.login-card .alert li {
  margin: 0.25rem 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 0 1rem;
  }

  .metrics-summary {
    grid-template-columns: 1fr;
  }

  .metric-value {
    font-size: 1.5rem;
  }

  .plan-type-summary {
    padding: 1.5rem;
  }

  .plan-type-grid {
    grid-template-columns: 1fr;
  }

  .daily-metrics-grid {
    grid-template-columns: 1fr;
  }

  .plan-type-mrr {
    font-size: 1.5rem;
  }

  .plan-breakdown {
    padding: 1.5rem;
  }

  .metrics-table {
    font-size: 0.875rem;
  }

  .metrics-table th,
  .metrics-table td {
    padding: 0.75rem 0.5rem;
  }

  .tabs-list {
    flex-wrap: wrap;
  }

  .tab-button {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .login-container {
    padding: 1rem;
    min-height: calc(100vh - 100px);
  }

  .login-card {
    padding: 2rem 1.5rem;
  }

  .login-card h2 {
    font-size: 1.5rem;
  }
}
