/**
 * Prime Self - Premium Edition
 * Porsche × Apple Design Philosophy
 * 
 * Design Principles:
 * - Precision over decoration
 * - Clarity through contrast  
 * - Timeless minimalism
 * - Functional beauty
 */

/* ─── Foundation ─────────────── */
@import url('./design-tokens-premium.css');
@import url('./icons.css');
@import url('./artwork.css');

/* ─── Component Library ─────────────── */
@import url('./base.css');
@import url('./components/buttons.css');
@import url('./components/cards.css');
@import url('./components/forms.css');
@import url('./components/tabs.css');
@import url('./components/modals.css');
@import url('./components/alerts.css');
@import url('./components/layout.css');

/* ─── Premium Overrides ─────────────── */

/* Global refinements */
body {
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Headings with display font */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

h2 {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
}

h3 {
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
}

h4 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
}

/* ─── Logo Premium ─────────────── */
.logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tighter);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.logo::before {
  content: '';
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, 
    var(--color-porsche-red) 0%, 
    var(--color-porsche-red-dark) 100%
  );
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.logo span {
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  color: var(--text-tertiary);
  letter-spacing: var(--tracking-normal);
}

/* ─── Header Premium ─────────────── */
.site-header {
  background: var(--bg-glass);
  backdrop-filter: var(--backdrop-blur-md);
  border-bottom: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
}

/* ─── Tabs Premium ─────────────── */
.tabs {
  background: transparent;
  border-bottom: 1px solid var(--border-secondary);
}

.tab-btn {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-tertiary);
  padding: var(--space-3) var(--space-5);
  position: relative;
  transition: color var(--duration-fast) var(--ease-out);
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  color: var(--text-primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-porsche-red);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* ─── Cards Premium ─────────────── */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ─── Buttons Premium ─────────────── */
.btn-primary, .btn {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  background: var(--color-porsche-red);
  color: white;
  border: none;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-fast) var(--ease-out);
  letter-spacing: var(--tracking-normal);
}

.btn-primary:hover, .btn:hover {
  background: var(--color-porsche-red-light);
  box-shadow: var(--shadow-md), var(--glow-red);
  transform: translateY(-1px);
}

.btn-primary:active, .btn:active {
  background: var(--color-porsche-red-dark);
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

/* ─── Forms Premium ─────────────── */
input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--duration-fast) var(--ease-out);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-porsche-red);
  box-shadow: 0 0 0 3px rgba(213, 0, 28, 0.1);
  background: var(--bg-secondary);
}

label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
  display: block;
}

/* ─── Alerts Premium ─────────────── */
.alert {
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  border-left: 3px solid;
}

.alert-success {
  background: rgba(48, 209, 88, 0.1);
  border-color: var(--color-success);
  color: var(--color-success);
}

.alert-error {
  background: rgba(255, 69, 58, 0.1);
  border-color: var(--color-error);
  color: var(--color-error);
}

.alert-info {
  background: rgba(10, 132, 255, 0.1);
  border-color: var(--color-info);
  color: var(--color-info);
}

/* ─── Loading States Premium ─────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-primary);
  border-top-color: var(--color-porsche-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-12);
  color: var(--text-tertiary);
  font-family: var(--font-body);
}

/* ─── Help Icons Premium ─────────────── */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  margin-left: var(--space-2);
  cursor: help;
  transition: all var(--duration-fast) var(--ease-out);
}

.help-icon:hover {
  background: var(--color-porsche-red);
  color: white;
  transform: scale(1.1);
}

/* ─── Badges & Pills Premium ─────────────── */
.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.badge-red {
  background: rgba(213, 0, 28, 0.15);
  color: var(--color-porsche-red);
  border: 1px solid rgba(213, 0, 28, 0.3);
}

.badge-gold {
  background: rgba(212, 175, 55, 0.15);
  color: var(--color-gold);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

/* ─── Forge Badges Premium ─────────────── */
.forge-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: linear-gradient(135deg,
    rgba(213, 0, 28, 0.1) 0%,
    rgba(163, 0, 21, 0.1) 100%
  );
  border: 1px solid rgba(213, 0, 28, 0.3);
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  color: var(--color-porsche-red);
  font-size: var(--text-base);
}

/* ─── Data Display Premium ─────────────── */
.data-block {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  overflow-x: auto;
}

/* ─── Section Headers Premium ─────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin: var(--space-8) 0 var(--space-4);
  position: relative;
  padding-bottom: var(--space-3);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--color-porsche-red);
  border-radius: var(--radius-sm);
}

/* ─── Responsive Refinements ─────────────── */
@media (max-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
  
  .card {
    border-radius: var(--radius-lg);
  }
  
  .section-title {
    font-size: var(--text-xl);
  }
}

/* ─── Animations Premium ─────────────── */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fade-in var(--duration-slow) var(--ease-out);
}

/* ─── Print Styles ─────────────── */
@media print {
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }
  
  .site-header,
  .tabs,
  .btn,
  button {
    display: none !important;
  }
}
