/**
 * Image Share - Modern Stylesheet
 */

/* ============================================
   CSS Variables - Design System
   ============================================ */
:root {
  /* Colors - Modern Neutral Palette */
  --color-bg: #0f0f0f;
  --color-surface: #1a1a1a;
  --color-surface-elevated: #242424;
  --color-surface-hover: #2a2a2a;
  --color-border: #333333;
  --color-border-subtle: #2a2a2a;
  
  /* Text */
  --color-text: #ffffff;
  --color-text-secondary: #a0a0a0;
  --color-text-muted: #666666;
  
  /* Accent - Electric Blue */
  --color-accent: #3b82f6;
  --color-accent-hover: #2563eb;
  --color-accent-glow: rgba(59, 130, 246, 0.3);
  
  /* Semantic */
  --color-success: #10b981;
  --color-error: #ef4444;
  --color-warning: #f59e0b;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px var(--color-accent-glow);
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  
  /* Layout */
  --max-width: 900px;
  --header-height: 120px;
}

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

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

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   Layout
   ============================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg);
}

/* ============================================
   Header
   ============================================ */
.header {
  text-align: center;
  padding: var(--space-3xl) 0;
  margin-bottom: var(--space-xl);
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--color-accent), #60a5fa);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-glow);
}

.logo svg {
  width: 36px;
  height: 36px;
  color: white;
}

.header h1 {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.header h1 span {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}

.header-nav {
  display: inline-flex;
  gap: var(--space-sm);
  padding: var(--space-xs);
  background: var(--color-surface);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-subtle);
}

.header-nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all var(--transition-base);
}

.header-nav a:hover {
  color: var(--color-text);
  background: var(--color-surface-hover);
}

.header-nav a.active {
  color: var(--color-text);
  background: var(--color-accent);
}

/* ============================================
   Main Content Cards
   ============================================ */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.card-header {
  margin-bottom: var(--space-lg);
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-xs);
}

/* ============================================
   Drop Zone
   ============================================ */
.drop-zone {
  position: relative;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--color-surface-elevated);
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--color-accent-glow), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--color-accent);
}

.drop-zone:hover::before,
.drop-zone.drag-over::before {
  opacity: 1;
}

.drop-zone.drag-over {
  transform: scale(1.01);
}

.drop-zone-content {
  position: relative;
  z-index: 1;
}

.drop-zone-icon {
  width: 64px;
  height: 64px;
  color: var(--color-text-muted);
  margin: 0 auto var(--space-lg);
  transition: all var(--transition-base);
}

.drop-zone:hover .drop-zone-icon,
.drop-zone.drag-over .drop-zone-icon {
  color: var(--color-accent);
  transform: translateY(-4px);
}

.drop-zone h2 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.drop-zone p {
  color: var(--color-text-secondary);
}

.drop-zone .file-info {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-md);
}

/* ============================================
   Upload Progress
   ============================================ */
.upload-progress {
  text-align: center;
  padding: var(--space-xl);
}

.progress-track {
  height: 6px;
  background: var(--color-surface-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), #60a5fa);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width var(--transition-base);
}

.progress-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* ============================================
   Upload Result
   ============================================ */
.upload-result,
.upload-error {
  text-align: center;
  padding: var(--space-2xl);
}

.result-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  font-size: 2rem;
}

.result-icon.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.result-icon.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-error);
}

.upload-result h3,
.upload-error h3 {
  font-size: var(--font-size-2xl);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.upload-result p,
.upload-error p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}

.share-link-box {
  display: flex;
  gap: var(--space-sm);
  max-width: 400px;
  margin: 0 auto var(--space-lg);
}

.share-link-box input {
  flex: 1;
  padding: var(--space-md);
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

.share-link-box input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.result-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-surface-hover);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-surface-elevated);
  border-color: var(--color-text-muted);
}

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

.btn-ghost:hover {
  color: var(--color-text);
  background: var(--color-surface-hover);
}

.btn-copy {
  background: var(--color-accent);
  color: white;
  padding: var(--space-md);
}

.btn-copy:hover {
  background: var(--color-accent-hover);
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--font-size-lg);
}

/* ============================================
   Recent Uploads
   ============================================ */
.recent-section {
  margin-top: var(--space-xl);
}

.recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.recent-header h2 {
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-md);
}

.recent-item {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-base);
  border: 1px solid var(--color-border-subtle);
}

.recent-item:hover {
  transform: translateY(-4px);
  border-color: var(--color-border);
  box-shadow: var(--shadow-lg);
}

.recent-item a {
  display: block;
}

.recent-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.recent-info {
  padding: var(--space-sm) var(--space-md);
}

.recent-name {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.recent-views {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  text-align: center;
  padding: var(--space-2xl) 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* ============================================
   Utilities
   ============================================ */
.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading States */
.loading,
.no-uploads,
.error {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--color-text-muted);
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--color-bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: var(--space-2xl);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-subtle);
  animation: slideUp 0.4s ease;
}

.login-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--color-accent), #60a5fa);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
}

.login-logo svg {
  width: 28px;
  height: 28px;
  color: white;
}

.login-card h1 {
  text-align: center;
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.login-card .subtitle {
  text-align: center;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xl);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.form-group input {
  width: 100%;
  padding: var(--space-md);
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--font-size-base);
  transition: border-color var(--transition-fast);
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.alert {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  font-size: var(--font-size-sm);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.login-footer {
  text-align: center;
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.login-footer a {
  font-size: var(--font-size-sm);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
  :root {
    --font-size-4xl: 2rem;
  }
  
  .header {
    padding: var(--space-2xl) 0;
  }
  
  .container {
    padding: var(--space-md);
  }
  
  .card {
    padding: var(--space-lg);
  }
  
  .drop-zone {
    padding: var(--space-xl) var(--space-lg);
  }
  
  .share-link-box {
    flex-direction: column;
  }
  
  .result-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  .recent-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .header-nav a {
    padding: var(--space-sm) var(--space-md);
  }
}