/* 3D Studio Styles */

/* Studio Header */
.studio-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.studio-nav {
    display: flex;
    gap: 0.5rem;
}

.studio-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.studio-nav-btn:hover {
    background: rgba(51, 65, 85, 0.5);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.3);
}

.studio-nav-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.studio-nav-btn .icon {
    width: 20px;
    height: 20px;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

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

/* Viewer Container */
.viewer-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 1024px) {
    .viewer-container {
        grid-template-columns: 1fr;
    }
}

/* Viewer Controls */
.viewer-controls {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #475569 #1e293b;
}

.viewer-controls::-webkit-scrollbar {
    width: 6px;
}

.viewer-controls::-webkit-scrollbar-track {
    background: #1e293b;
}

.viewer-controls::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.select-input {
    width: 100%;
    padding: 0.5rem 1rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
    color: #e2e8f0;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.select-input:hover,
.select-input:focus {
    background: rgba(51, 65, 85, 0.5);
    border-color: #2563eb;
    outline: none;
}

/* Color Options */
.color-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.color-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.color-btn:hover {
    transform: scale(1.1);
    border-color: #2563eb;
}

.color-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

#custom-color {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.2);
    cursor: pointer;
    background: transparent;
}

/* Wheel Options */
.wheel-options,
.style-options,
.camera-presets {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wheel-btn,
.style-btn,
.camera-btn {
    padding: 0.5rem 1rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
    color: #94a3b8;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.wheel-btn:hover,
.style-btn:hover,
.camera-btn:hover {
    background: rgba(51, 65, 85, 0.5);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.3);
}

.wheel-btn.active,
.style-btn.active,
.camera-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Action Buttons */
.actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 2rem;
}

.primary-btn,
.secondary-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.primary-btn {
    background: #2563eb;
    color: white;
}

.primary-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.secondary-btn {
    background: rgba(51, 65, 85, 0.5);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.secondary-btn:hover {
    background: rgba(71, 85, 105, 0.5);
    border-color: rgba(148, 163, 184, 0.3);
}

/* 3D Viewer */
.viewer-3d {
    position: relative;
    background: #0f172a;
    border-radius: 0.75rem;
    overflow: hidden;
    min-height: 600px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

#three-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #94a3b8;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(148, 163, 184, 0.2);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Card Generator */
.card-generator {
    display: grid;
    grid-template-columns: minmax(360px, 420px) 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .card-generator {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.card-preview-panel {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 0.75rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-self: start;
    position: relative;
    overflow: hidden;
}

.preview-header .badge {
    background: rgba(24, 225, 255, 0.12);
    color: #7de8ff;
    border: 1px solid rgba(24, 225, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Photo Upload Area */
.photo-upload-area {
    position: relative;
    border: 2px dashed rgba(148, 163, 184, 0.3);
    border-radius: 0.75rem;
    background: rgba(30, 41, 59, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.photo-upload-area:hover {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
}

.photo-upload-area.dragover {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.2);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #94a3b8;
    text-align: center;
}

.upload-placeholder svg {
    margin-bottom: 1rem;
    opacity: 0.6;
}

.upload-placeholder p {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.upload-hint {
    font-size: 0.75rem;
    opacity: 0.6;
}

#photo-preview {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.remove-photo-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 0.5rem;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-photo-btn:hover {
    background: #dc2626;
}

.card-form {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 1rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
    color: #e2e8f0;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    background: rgba(51, 65, 85, 0.5);
    border-color: #2563eb;
    outline: none;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Awards Container */
#awards-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.award-input {
    display: flex;
    gap: 0.5rem;
}

.award-field {
    flex: 1;
    padding: 0.5rem 1rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
    color: #e2e8f0;
    font-size: 0.875rem;
}

.remove-award {
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    color: #fca5a5;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-award:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

.add-btn {
    padding: 0.5rem 1rem;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 0.5rem;
    color: #86efac;
    cursor: pointer;
    transition: all 0.2s;
}

.add-btn:hover {
    background: rgba(34, 197, 94, 0.3);
    border-color: rgba(34, 197, 94, 0.5);
}

/* Card Themes */
.card-themes {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.theme-btn {
    padding: 0.5rem 1rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
    color: #94a3b8;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-btn:hover {
    background: rgba(51, 65, 85, 0.5);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.3);
}

.theme-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Card Preview */
.card-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.car-card {
    width: 400px;
    max-width: 100%;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.car-card.classic-theme {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #212529;
}

.car-card.modern-theme {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
}

.car-card.racing-theme {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
}

.car-card.vintage-theme {
    background: linear-gradient(135deg, #92400e 0%, #78350f 100%);
    color: #fef3c7;
}

.card-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.car-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: bold;
}

.owner-info {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #0f172a;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.style-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    background: rgba(37, 99, 235, 0.9);
    color: white;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.card-specs {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.spec-label {
    font-weight: 500;
    opacity: 0.7;
}

.spec-value {
    font-weight: 600;
}

.card-mods {
    padding: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.card-mods h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

#mods-list {
    margin: 0;
    padding-left: 1.5rem;
    font-size: 0.875rem;
}

.card-awards {
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.award-badge {
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.card-qr {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

#qr-code {
    width: 100px;
    height: 100px;
}

.qr-label {
    font-size: 0.875rem;
    opacity: 0.7;
}

.card-footer {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
}

.garage-pass-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.card-id {
    font-size: 0.75rem;
    opacity: 0.7;
    font-family: monospace;
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    max-width: none;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.card-actions .primary-btn,
.card-actions .secondary-btn {
    min-width: 140px;
}

/* Gallery */
.gallery-container {
    padding: 1.5rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 0.75rem;
    margin-top: 1rem;
}

.gallery-container h2 {
    margin: 0 0 1.5rem;
    color: #e2e8f0;
}

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

.gallery-item {
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item .car-card {
    width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .studio-nav {
        flex-direction: column;
        width: 100%;
    }
    
    .studio-nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .viewer-container,
    .card-generator {
        grid-template-columns: 1fr;
    }
    
    .viewer-3d {
        min-height: 400px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    /* Hide everything first */
    body * {
        visibility: hidden;
    }
    
    /* Show the card and all its children */
    .gp-card,
    .gp-card *,
    .gp-card-preview-wrapper,
    .gp-card-preview-wrapper *,
    .car-card,
    .car-card * {
        visibility: visible !important;
    }
    
    /* Position the card for printing */
    .gp-card,
    .car-card {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 350px;
        max-width: 100%;
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: 1px solid #ccc;
    }
    
    .gp-card-preview-wrapper {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Ensure images print */
    .gp-card img,
    .car-card img {
        max-width: 100%;
        height: auto;
    }
    
    /* Reset dark backgrounds for print */
    .gp-card .gp-card-front,
    .gp-card .gp-card-back {
        background: white !important;
        color: black !important;
    }
}

/* Notification Styles */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.notification-success {
    background: #10b981;
}

.notification-error {
    background: #ef4444;
}

.notification-info {
    background: #3b82f6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GARAGE PASS COLLECTIBLE CARD SYSTEM
   ═══════════════════════════════════════════════════════════════════════════ */

/* Container for preview section */
.gp-card-preview-wrapper {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}
.card-preview-panel .gp-card-preview-wrapper {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(12, 17, 26, 0.45);
  border: 1px dashed rgba(148, 163, 184, 0.25);
  border-radius: 0.75rem;
}
.card-preview-panel .gp-card {
  max-width: 360px;
}

/* Gallery for saved cards */
.gp-card-gallery {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Core card */
.gp-card {
  --gp-border-color: rgba(0, 255, 255, 0.7);
  --gp-glow-color: rgba(0, 255, 255, 0.6);
  --gp-bg1: #02040b;
  --gp-bg2: #06121f;
  --gp-accent: #00f5ff;

  position: relative;
  width: 100%;
  max-width: 320px;
  border-radius: 22px;
  padding: 18px 18px 20px;
  background: radial-gradient(circle at top, var(--gp-bg2) 0, var(--gp-bg1) 55%, #000 100%);
  border: 1px solid var(--gp-border-color);
  box-shadow: 0 0 20px var(--gp-glow-color);
  color: #f7fbff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;

  /* 3D tilt base */
  perspective: 1000px;
}

/* Inner wrapper to tilt */
.gp-card-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 180ms ease-out, box-shadow 180ms ease-out;
}

/* subtle 3D tilt fallback on hover (desktop) */
@media (hover: hover) and (pointer: fine) {
  .gp-card:hover .gp-card-inner {
    transform: rotateX(6deg) rotateY(-6deg) translateY(-2px);
  }
}

/* background glow layers */
.gp-card::before,
.gp-card::after {
  content: "";
  position: absolute;
  inset: -40%;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.35;
  background:
    radial-gradient(circle at 10% 0, rgba(0, 255, 255, 0.35), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(0, 180, 255, 0.35), transparent 55%);
}

/* ── Rarity color variants ── */
.gp-card[data-rarity="common"] {
  --gp-border-color: rgba(255, 255, 255, 0.25);
  --gp-glow-color: rgba(160, 160, 160, 0.35);
  --gp-accent: #e4e4e4;
}

.gp-card[data-rarity="rare"] {
  --gp-border-color: rgba(0, 255, 255, 0.7);
  --gp-glow-color: rgba(0, 255, 255, 0.55);
  --gp-accent: #00f5ff;
}

.gp-card[data-rarity="legendary"] {
  --gp-border-color: rgba(255, 107, 255, 0.9);
  --gp-glow-color: rgba(255, 107, 255, 0.8);
  --gp-accent: #ff6bff;
}

/* ── Holographic / Foil effect for Legendary ── */
.gp-card[data-rarity="legendary"]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 22px;
  background: linear-gradient(
    125deg,
    rgba(255, 0, 255, 0.1) 0%,
    rgba(0, 255, 255, 0.15) 25%,
    rgba(255, 255, 0, 0.1) 50%,
    rgba(0, 255, 255, 0.15) 75%,
    rgba(255, 0, 255, 0.1) 100%
  );
  background-size: 400% 400%;
  animation: holographic-shimmer 6s ease-in-out infinite;
  mix-blend-mode: overlay;
  opacity: 0.6;
  z-index: 10;
}

@keyframes holographic-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ── Event themes (background flavor) ── */
.gp-card[data-theme="sema"]::before {
  background:
    radial-gradient(circle at 0 0, rgba(255, 107, 255, 0.45), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(0, 255, 255, 0.35), transparent 55%);
}

.gp-card[data-theme="cars-and-coffee"]::before {
  background:
    radial-gradient(circle at 0 0, rgba(255, 196, 0, 0.35), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(0, 140, 255, 0.35), transparent 55%);
}

.gp-card[data-theme="racing"]::before {
  background:
    radial-gradient(circle at 0 0, rgba(255, 50, 50, 0.45), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(255, 200, 0, 0.35), transparent 55%);
}

.gp-card[data-theme="vintage"]::before {
  background:
    radial-gradient(circle at 0 0, rgba(180, 140, 80, 0.45), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(100, 80, 60, 0.35), transparent 55%);
}

/* ── Card Header ── */
.gp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.gp-brand-block {
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 10px;
}

.gp-brand-label {
  opacity: 0.75;
}

.gp-brand-title {
  font-size: 12px;
  font-weight: 700;
}

.gp-rarity-pill {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--gp-accent);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--gp-accent);
  background: rgba(0, 0, 0, 0.4);
}

/* ── Title area ── */
.gp-car-title {
  margin-top: 6px;
  position: relative;
  z-index: 1;
}

.gp-car-name {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0;
}

.gp-car-subtitle {
  font-size: 11px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 4px;
}

/* ── Image frame ── */
.gp-image-frame {
  margin-top: 10px;
  border-radius: 18px;
  padding: 10px;
  background:
    radial-gradient(circle at 10% 0, rgba(0, 255, 255, 0.18), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(0, 255, 255, 0.28), transparent 55%);
  position: relative;
  z-index: 1;
}

.gp-card[data-theme="sema"] .gp-image-frame {
  background:
    radial-gradient(circle at 10% 0, rgba(255, 107, 255, 0.3), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(0, 255, 255, 0.25), transparent 55%);
}

.gp-card[data-theme="racing"] .gp-image-frame {
  background:
    radial-gradient(circle at 10% 0, rgba(255, 50, 50, 0.3), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(255, 200, 0, 0.25), transparent 55%);
}

.gp-car-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(135deg, #050b16, #0b1320);
  display: block;
}

.gp-car-image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.7);
  height: 160px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(135deg, #050b16, #0b1320);
}

/* ── Stats row ── */
.gp-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

.gp-stat-block {
  flex: 1 1 30%;
  min-width: 80px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.gp-stat-label {
  opacity: 0.7;
}

.gp-stat-value {
  font-size: 13px;
  font-weight: 700;
}

.gp-stat-value--accent {
  color: var(--gp-accent);
}

/* ── Footer ── */
.gp-card-footer {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.gp-cta-button {
  width: 100%;
  padding: 9px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #00ffd8, #00b7ff);
  color: #00121b;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.gp-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 255, 216, 0.4);
}

.gp-cta-button:active {
  transform: translateY(1px) scale(0.99);
}

.gp-footer-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  opacity: 0.8;
}

.gp-footer-link {
  cursor: pointer;
  transition: color 0.2s, opacity 0.2s;
}

.gp-footer-link:hover {
  color: var(--gp-accent);
  opacity: 1;
}

.gp-status {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  opacity: 0.85;
}

.gp-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 1px solid var(--gp-accent);
  box-shadow: 0 0 8px var(--gp-accent);
  background: radial-gradient(circle, var(--gp-accent) 0, rgba(0, 0, 0, 0) 70%);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

/* ── QR + ID row ── */
.gp-meta-row {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
}

.gp-card-id {
  font-family: "Courier New", monospace;
}

/* ── Responsive tweaks ── */
@media (max-width: 600px) {
  .gp-card {
    padding: 16px 14px 18px;
    max-width: 100%;
  }

  .gp-car-name {
    font-size: 16px;
  }

  .gp-card-gallery {
    grid-template-columns: 1fr;
  }
}

/* Gallery empty state toggle */
.gp-card-gallery:not(:empty) + #gallery-empty-state {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE-FIRST CARD CREATOR EXPERIENCE
   Optimized for creating cards on your phone
   ═══════════════════════════════════════════════════════════════════════════ */

/* Mobile Layout - Stack everything vertically */
@media (max-width: 768px) {
  /* Page body adjustments */
  .page-3d-studio {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  /* Main container */
  #studio-app.wrap {
    padding: 0 12px;
  }

  /* Studio header - make it compact */
  .studio-header {
    padding: 12px !important;
    margin-top: 8px !important;
  }

  .studio-header .flex-between {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .studio-header .section-title {
    font-size: 1.25rem;
    text-align: center;
  }

  /* Tab navigation - horizontal scroll */
  .studio-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
  }

  .studio-nav::-webkit-scrollbar {
    display: none;
  }

  .studio-nav-btn {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
    justify-content: center;
  }

  .studio-nav-btn .icon {
    width: 18px;
    height: 18px;
  }

  /* Card Generator - single column */
  .card-generator {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  /* Form section */
  .card-form {
    padding: 16px !important;
    margin-top: 8px !important;
  }

  .card-form .section-title {
    font-size: 1.1rem;
    margin-bottom: 16px;
  }

  /* Form groups - larger touch targets */
  .form-group {
    margin-bottom: 16px;
  }

  .form-group label {
    font-size: 0.8rem;
    margin-bottom: 8px;
  }

  .form-group input,
  .form-group textarea {
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 12px;
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  /* Photo upload - make it prominent on mobile */
  .photo-upload-area {
    border-radius: 16px;
    min-height: 180px;
  }

  .upload-placeholder {
    padding: 24px 16px;
  }

  .upload-placeholder svg {
    width: 56px;
    height: 56px;
  }

  .upload-placeholder p {
    font-size: 1rem;
    margin-top: 12px;
  }

  #photo-preview {
    height: 220px;
  }

  .remove-photo-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  /* Card themes - grid on mobile */
  .card-themes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .theme-btn {
    padding: 12px 8px;
    font-size: 0.85rem;
    text-align: center;
    border-radius: 12px;
  }

  /* Generate button - full width, sticky */
  #generate-card {
    position: sticky;
    bottom: 16px;
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    border-radius: 16px;
    z-index: 50;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  }

  /* GP Card Preview wrapper */
  .gp-card-preview-wrapper {
    margin-top: 20px;
    padding: 0;
  }

  /* Card on mobile - full width */
  .gp-card {
    max-width: 100%;
    margin: 0 auto;
  }

  /* Card actions below preview */
  .card-actions {
    flex-direction: column;
    gap: 10px;
    max-width: 100%;
    padding: 0;
    margin-top: 16px !important;
  }

  .card-actions .primary-btn,
  .card-actions .secondary-btn {
    width: 100%;
    padding: 14px;
    font-size: 0.95rem;
    border-radius: 12px;
  }

  /* Gallery tab */
  .gallery-container {
    padding: 16px !important;
    margin-top: 8px !important;
  }

  .gallery-container .section-title {
    font-size: 1.1rem;
  }

  .gp-card-gallery {
    gap: 16px;
    margin-top: 16px;
  }

  /* Awards container */
  #awards-container {
    gap: 10px;
  }

  .award-input {
    flex-direction: column;
    gap: 8px;
  }

  .award-field {
    padding: 12px 14px;
    font-size: 16px;
  }

  .add-btn,
  .remove-award {
    padding: 12px 16px;
    font-size: 0.9rem;
    border-radius: 10px;
  }
}

/* Extra small screens (iPhone SE, etc) */
@media (max-width: 375px) {
  .studio-nav-btn {
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  .studio-nav-btn span {
    display: none;
  }

  .studio-nav-btn .icon {
    margin: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .card-themes {
    grid-template-columns: repeat(2, 1fr);
  }

  .theme-btn {
    padding: 10px 6px;
    font-size: 0.8rem;
  }

  .gp-car-name {
    font-size: 15px;
  }

  .gp-stats-row {
    gap: 8px;
  }

  .gp-stat-block {
    flex: 1 1 45%;
  }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
  /* Disable hover effects on touch devices */
  .gp-card:hover .gp-card-inner {
    transform: none;
  }

  /* Add active states instead */
  .gp-card:active .gp-card-inner {
    transform: scale(0.98);
  }

  .theme-btn:active,
  .studio-nav-btn:active,
  .primary-btn:active,
  .secondary-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
  }

  /* Larger tap targets */
  .gp-footer-link {
    padding: 8px 12px;
    margin: -8px -12px;
  }

  .gp-cta-button {
    padding: 14px 16px;
    font-size: 13px;
  }
}

/* Mobile camera button for quick photo capture */
.mobile-camera-capture {
  display: none;
}

@media (max-width: 768px) {
  .mobile-camera-capture {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    margin-top: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
  }

  .mobile-camera-capture:active {
    transform: scale(0.98);
  }

  .mobile-camera-capture svg {
    width: 22px;
    height: 22px;
  }
}

/* Safe area support for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    .page-3d-studio {
      padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    #generate-card {
      margin-bottom: env(safe-area-inset-bottom);
    }
  }
}

/* Landscape mode on mobile */
@media (max-width: 900px) and (orientation: landscape) {
  .card-generator {
    grid-template-columns: 1fr 1fr !important;
  }

  .card-form {
    max-height: 70vh;
    overflow-y: auto;
  }

  .gp-card-preview-wrapper {
    position: sticky;
    top: 12px;
  }

  .gp-card {
    max-width: 280px;
  }

  .gp-car-image {
    height: 120px;
  }
}

/* Dark mode scrollbar for mobile */
@media (max-width: 768px) {
  .card-form::-webkit-scrollbar,
  .gallery-container::-webkit-scrollbar {
    width: 4px;
  }

  .card-form::-webkit-scrollbar-track,
  .gallery-container::-webkit-scrollbar-track {
    background: transparent;
  }

  .card-form::-webkit-scrollbar-thumb,
  .gallery-container::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 2px;
  }
}

/* Animation for card generation success */
@keyframes card-generated {
  0% { transform: scale(0.9); opacity: 0; }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

.gp-card-preview-wrapper .gp-card {
  animation: card-generated 0.4s ease-out;
}

/* Swipe hint for gallery on mobile */
@media (max-width: 768px) {
  .gp-card-gallery::after {
    content: "";
    display: block;
    height: 1px;
  }
}
