/* 
 * Marketive Portal Theme - World-Class Edition
 * A sophisticated dark theme with premium aesthetics
 */

/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Crimson+Pro:ital,wght@0,400;0,500;1,400&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  /* Colors - Dark Premium Palette */
  --color-bg-primary: #0a0a0f;
  --color-bg-secondary: #12121a;
  --color-bg-elevated: #1a1a24;
  --color-bg-card: rgba(26, 26, 36, 0.7);
  --color-bg-glass: rgba(255, 255, 255, 0.03);
  
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-hover: rgba(255, 255, 255, 0.15);
  
  --color-text-primary: #f5f5f7;
  --color-text-secondary: #a1a1aa;
  --color-text-muted: #71717a;
  
  /* Accent Colors */
  --color-accent: #f59e0b;
  --color-accent-glow: rgba(245, 158, 11, 0.3);
  --color-accent-subtle: rgba(245, 158, 11, 0.1);
  
  /* Service Colors */
  --color-web: #3b82f6;
  --color-marketing: #ec4899;
  --color-ai: #8b5cf6;
  --color-branding: #f97316;
  --color-seo: #10b981;
  --color-strategy: #06b6d4;
  
  /* Status Colors */
  --color-status-draft: #71717a;
  --color-status-active: #22c55e;
  --color-status-completed: #3b82f6;
  --color-status-archived: #a1a1aa;
  
  /* Typography */
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-serif: 'Crimson Pro', Georgia, serif;
  
  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px var(--color-accent-glow);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  min-height: 100vh;
}

/* ===== ANIMATED BACKGROUND ===== */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(245, 158, 11, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(139, 92, 246, 0.1), transparent),
    radial-gradient(ellipse 40% 60% at 0% 80%, rgba(59, 130, 246, 0.08), transparent),
    var(--color-bg-primary);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p {
  color: var(--color-text-secondary);
  max-width: 65ch;
}

.text-gradient {
  background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-16) 0;
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: var(--space-4) 0;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.logo-mark {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-accent), #fbbf24);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-bg-primary);
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-text-primary);
  letter-spacing: -0.03em;
}

.nav-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-glass);
}

/* ===== HERO ===== */
.hero {
  padding: var(--space-20) 0 var(--space-16);
  text-align: center;
}

.hero h1 {
  margin-bottom: var(--space-4);
  animation: fadeUp 0.8s ease-out;
}

.hero p {
  font-size: 1.125rem;
  margin: 0 auto var(--space-8);
  animation: fadeUp 0.8s ease-out 0.1s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-12);
  animation: fadeUp 0.8s ease-out 0.2s both;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ===== FILTERS ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-8);
  backdrop-filter: blur(10px);
  animation: fadeUp 0.8s ease-out 0.3s both;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.filter-select,
.search-input {
  appearance: none;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.filter-select:hover,
.search-input:hover {
  border-color: var(--color-border-hover);
}

.filter-select:focus,
.search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.search-input {
  width: 280px;
  padding-left: var(--space-10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: var(--space-3) center;
}

/* ===== GRID ===== */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: var(--space-6);
}

/* ===== CARDS ===== */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, var(--color-bg-glass));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card:hover::before {
  opacity: 1;
}

/* Client Card Specific */
.client-card {
  animation: fadeUp 0.6s ease-out both;
}

.client-card:nth-child(1) { animation-delay: 0.1s; }
.client-card:nth-child(2) { animation-delay: 0.15s; }
.client-card:nth-child(3) { animation-delay: 0.2s; }
.client-card:nth-child(4) { animation-delay: 0.25s; }
.client-card:nth-child(5) { animation-delay: 0.3s; }
.client-card:nth-child(6) { animation-delay: 0.35s; }

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  position: relative;
  z-index: 1;
}

.client-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: white;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-accent), #fbbf24);
  box-shadow: 0 4px 12px var(--color-accent-glow);
}

.client-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.client-info {
  flex: 1;
  min-width: 0;
}

.client-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-name a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.client-name a:hover {
  color: var(--color-accent);
}

.client-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.project-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  min-width: 28px;
}

/* Projects List */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
  z-index: 1;
}

.project-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.project-item:hover {
  background: var(--color-bg-glass);
  transform: translateX(4px);
}

.project-title {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.badge-service {
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border);
}

.badge-service.web { color: var(--color-web); border-color: rgba(59, 130, 246, 0.3); }
.badge-service.marketing { color: var(--color-marketing); border-color: rgba(236, 72, 153, 0.3); }
.badge-service.ai { color: var(--color-ai); border-color: rgba(139, 92, 246, 0.3); }
.badge-service.branding { color: var(--color-branding); border-color: rgba(249, 115, 22, 0.3); }
.badge-service.seo { color: var(--color-seo); border-color: rgba(16, 185, 129, 0.3); }
.badge-service.strategy { color: var(--color-strategy); border-color: rgba(6, 182, 212, 0.3); }

.badge-status {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.badge-status.draft { background: rgba(113, 113, 122, 0.2); color: var(--color-status-draft); }
.badge-status.active { background: rgba(34, 197, 94, 0.15); color: var(--color-status-active); }
.badge-status.completed { background: rgba(59, 130, 246, 0.15); color: var(--color-status-completed); }
.badge-status.archived { background: rgba(161, 161, 170, 0.15); color: var(--color-status-archived); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent), #fbbf24);
  color: var(--color-bg-primary);
  box-shadow: 0 4px 14px var(--color-accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--color-accent-glow);
}

.btn-secondary {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg-glass);
  border-color: var(--color-border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-glass);
}

/* ===== VERSION HEADER ===== */
.version-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-6);
}

.version-header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.version-info {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.version-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.version-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.version-selector {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.version-selector label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.version-selector select {
  appearance: none;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-8) var(--space-2) var(--space-3);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-primary);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-2) center;
  transition: all var(--transition-fast);
}

.version-selector select:hover {
  border-color: var(--color-border-hover);
}

.version-selector select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

/* ===== PORTAL SPECIFICS ===== */
.portal-hero {
  padding: var(--space-16) 0;
  text-align: center;
  position: relative;
}

.portal-hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--client-color, var(--color-accent)) 0%, transparent 70%);
  opacity: 0.1;
  pointer-events: none;
}

.portal-logo {
  width: 100px;
  height: 100px;
  margin: 0 auto var(--space-6);
  border-radius: var(--radius-2xl);
  background: linear-gradient(135deg, var(--client-color, var(--color-accent)), var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.3);
  animation: float 6s ease-in-out infinite;
}

.portal-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

.service-section {
  margin-bottom: var(--space-12);
}

.service-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.service-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.service-icon.web { background: rgba(59, 130, 246, 0.15); color: var(--color-web); }
.service-icon.marketing { background: rgba(236, 72, 153, 0.15); color: var(--color-marketing); }
.service-icon.ai { background: rgba(139, 92, 246, 0.15); color: var(--color-ai); }
.service-icon.branding { background: rgba(249, 115, 22, 0.15); color: var(--color-branding); }
.service-icon.seo { background: rgba(16, 185, 129, 0.15); color: var(--color-seo); }
.service-icon.strategy { background: rgba(6, 182, 212, 0.15); color: var(--color-strategy); }

.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.deliverables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}

.deliverable-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text-primary);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.deliverable-link:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
  transform: translateY(-2px);
}

.deliverable-link::before {
  content: '📄';
  font-size: 1.25rem;
}

.deliverable-link[href*="proposal"]::before { content: '📋'; }
.deliverable-link[href*="plan"]::before { content: '📅'; }
.deliverable-link[href*="report"]::before { content: '📊'; }
.deliverable-link[href*="audit"]::before { content: '🔍'; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: var(--space-16);
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

/* ===== FOOTER ===== */
.footer {
  padding: var(--space-8) 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-16);
}

.footer-text {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.footer-brand {
  color: var(--color-accent);
  font-weight: 600;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-elevated) 25%,
    var(--color-bg-card) 50%,
    var(--color-bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-4);
  }
  
  .hero {
    padding: var(--space-12) 0 var(--space-8);
  }
  
  .hero-stats {
    flex-direction: column;
    gap: var(--space-6);
  }
  
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-input {
    width: 100%;
  }
  
  .client-grid {
    grid-template-columns: 1fr;
  }
  
  .header-content {
    flex-direction: column;
    gap: var(--space-3);
  }
  
  .version-header-content {
    flex-direction: column;
    text-align: center;
  }
}

/* ===== PRINT ===== */
@media print {
  .header,
  .footer,
  .version-header,
  .filters {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    background: white;
    border: 1px solid #ddd;
    box-shadow: none;
  }
}
