/* ==========================================================================
   PICFORGE — Clean Modern Photo Suite (Ultra Dark Glassmorphism)
   ========================================================================== */

:root {
  --bg-main: #0a0b0e;
  --bg-surface: #12141a;
  --bg-card: rgba(22, 25, 35, 0.75);
  --bg-card-hover: rgba(30, 35, 50, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 242, 254, 0.4);
  
  --primary: #00f2fe;
  --primary-glow: rgba(0, 242, 254, 0.35);
  --accent-purple: #9d4edd;
  --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #9d4edd 100%);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --danger: #ef4444;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(0, 242, 254, 0.07) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(157, 78, 221, 0.08) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-accent { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.hidden { display: none !important; }

/* Header Navigation */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 11, 14, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.logo-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #0a0b0e;
  box-shadow: 0 0 16px var(--primary-glow);
}

.logo-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-tag {
  display: block;
  font-size: 10.5px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tool Navigation Links */
.tool-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
  background: var(--accent-gradient);
  color: #0a0b0e;
  box-shadow: 0 0 14px var(--primary-glow);
}

.privacy-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 40px 20px 24px 20px;
}

.hero-content {
  max-width: 760px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero-section h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero-section p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

/* Ad Banner Slot */
.ad-banner-wrapper {
  display: flex;
  justify-content: center;
  margin: 12px auto 24px auto;
  max-width: 1280px;
  padding: 0 20px;
}

.ad-slot-box {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
}

/* Main Workspace */
.app-main-workspace {
  flex: 1;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px 40px 20px;
}

/* Dropzone Styles */
.dropzone-card {
  border: 2px dashed rgba(0, 242, 254, 0.35);
  border-radius: var(--radius-lg);
  padding: 50px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.dropzone-card:hover, .dropzone-card.drag-over {
  border-color: var(--primary);
  background: rgba(0, 242, 254, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--primary-glow);
}

.drop-icon-circle {
  width: 64px;
  height: 64px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--primary);
  margin: 0 auto 16px auto;
}

.dropzone-content h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.browse-link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.dropzone-content p {
  color: var(--text-dim);
  font-size: 13px;
}

.file-input-hidden { display: none; }

/* Tool Controls Bar */
.tool-controls-bar {
  margin-top: 24px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.styled-slider {
  -webkit-appearance: none;
  width: 180px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.styled-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 10px var(--primary-glow);
}

.styled-select {
  background: #14161f;
  color: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
}

.styled-select:focus {
  border-color: var(--primary);
}

.control-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Button Styles */
.btn-primary {
  background: var(--accent-gradient);
  color: #0a0b0e;
  border: none;
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  box-shadow: 0 0 18px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-success:hover {
  box-shadow: 0 0 18px var(--success-glow);
  transform: translateY(-1px);
}

/* Processed Results Grid */
.processed-grid-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.img-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}

.img-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.card-thumb-wrap {
  width: 100%;
  height: 140px;
  border-radius: var(--radius-sm);
  background: #0a0b0e;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.card-thumb-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-saving-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #10b981;
  color: #0a0b0e;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-filename {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-stats {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.btn-card-download {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-card-download:hover {
  background: var(--primary);
  color: #0a0b0e;
  border-color: var(--primary);
}

/* Background Remover / Mockup / Resize Workspaces */
.bgremove-workspace, .mockup-workspace, .resize-workspace {
  margin-top: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bgremove-toolbar, .mockup-toolbar, .resize-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.bg-options {
  display: flex;
  gap: 8px;
}

.bg-opt-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.bg-opt-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 242, 254, 0.1);
}

.bgremove-canvas-wrap, .mockup-canvas-container, .resize-canvas-container {
  width: 100%;
  min-height: 420px;
  background: #0d0f14;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px;
}

canvas {
  max-width: 100%;
  max-height: 520px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Features Grid */
.features-section {
  max-width: 1120px;
  margin: 40px auto 20px auto;
  padding: 0 20px;
}

.features-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.feature-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--primary);
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 24px 20px;
  background: #090a0d;
  margin-top: auto;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 12px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
  }
  .tool-nav-links {
    order: 3;
  }
  .header-actions {
    display: none;
  }
  .tool-controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .control-actions {
    flex-direction: column;
  }
}
