/* --- VARIABLES 2026 --- */
:root {
  --bg-dark: #050507;
  --card-bg: rgba(22, 22, 27, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.03);
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.25);
  --success: #10b981;
  
  --text-main: #ffffff;
  --text-muted: #8b8b93;
  
  --radius-panel: 32px;
  --radius-input: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  min-height: 100vh;
  background-color: var(--bg-dark);
  /* Mesh Gradient Background */
  background-image: 
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.1), transparent 40%),
    linear-gradient(to bottom, #050507, #0a0a0f);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow-x: hidden;
}

/* --- LAYOUT GRID --- */
.app-wrapper {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 4rem;
  align-items: center;
}

/* --- LEFT: CONTROL PANEL --- */
.control-panel {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-panel);
  padding: 2.5rem;
  box-shadow: 0 0 0 1px var(--glass-highlight) inset;
  position: relative;
}

.brand {
  margin-bottom: 2rem;
}
.brand h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(to right, #fff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  font-weight: 700;
}

/* Input Styles */
.form-group { margin-bottom: 1.25rem; }

label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

input[type="text"] {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--glass-border);
  padding: 1rem;
  border-radius: var(--radius-input);
  color: #fff;
  font-size: 0.95rem;
  transition: 0.3s;
}
input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Modern File Picker */
.file-dropzone {
  position: relative;
  height: 60px;
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-input);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  transition: 0.3s;
  overflow: hidden;
}
.file-dropzone:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--primary);
}

input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2;
}

.file-info {
  display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--text-muted);
}
.file-icon {
  width: 32px; height: 32px; background: rgba(255,255,255,0.1);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
}

/* Button */
.btn-generate {
  width: 100%;
  margin-top: 1rem;
  padding: 1.1rem;
  border: none;
  border-radius: var(--radius-input);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 10px 30px -10px var(--primary-glow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -10px var(--primary-glow);
}
.btn-generate:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- RIGHT: IPHONE 15 PRO MOCKUP --- */
.preview-stage {
  display: flex;
  justify-content: center;
  perspective: 1200px;
}

.iphone-15 {
  width: 330px; /* Lebar iPhone 15 Pro Max Ratio */
  height: 680px;
  background: #000;
  border-radius: 54px; /* Sudut lengkung khas iPhone baru */
  position: relative;
  
  /* THE TITANIUM FRAME EFFECT */
  box-shadow: 
    0 0 0 2px #454545, /* Inner darker rim */
    0 0 0 5px #75757a, /* Titanium Grey Frame */
    0 0 0 6px #2a2a2a, /* Outer gap */
    0 50px 100px -20px rgba(0,0,0,0.8); /* Depth Shadow */
  
  transform: rotateY(-5deg) rotateX(2deg);
  transition: transform 0.5s ease;
  z-index: 10;
}

.preview-stage:hover .iphone-15 {
  transform: rotateY(0) rotateX(0);
}

/* Screen Area */
.screen {
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  background: #0d0d0d;
  border-radius: 48px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* Dynamic Island */
.dynamic-island {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 28px;
  background: #000;
  border-radius: 20px;
  z-index: 20;
}

/* Physical Buttons (Side) */
.iphone-15::before { /* Vol Up/Down & Action Btn */
  content: '';
  position: absolute;
  left: -8px;
  top: 120px;
  width: 4px;
  height: 50px;
  background: #333;
  border-radius: 4px 0 0 4px;
  box-shadow: 0 60px 0 #333, 0 -60px 0 #333; /* Cheat for multiple buttons */
}
.iphone-15::after { /* Power Btn */
  content: '';
  position: absolute;
  right: -8px;
  top: 180px;
  width: 4px;
  height: 80px;
  background: #333;
  border-radius: 0 4px 4px 0;
}

/* Screen Reflection/Glare (Glossy look) */
.screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 40%, transparent 100%);
  pointer-events: none;
  z-index: 5;
}

/* Content inside Screen */
.placeholder-content {
  text-align: center; color: #333;
}
.placeholder-content svg { width: 50px; opacity: 0.2; }

.result-view {
  display: none; width: 100%; height: 100%; flex-direction: column;
}

#resultImage {
  width: 100%; height: 100%; object-fit: cover;
}

/* Floating Download */
.fab-download {
  position: absolute;
  bottom: 25px;
  right: 25px;
  width: 55px; height: 55px;
  background: #fff;
  color: #000;
  border-radius: 50%;
  display: none; /* Hidden default */
  align-items: center; justify-content: center;
  box-shadow: 0 5px 20px rgba(0,0,0,0.4);
  z-index: 30;
  text-decoration: none;
  transition: transform 0.2s;
}
.fab-download:hover { transform: scale(1.1); }

/* Footer */
.dev-mark {
  position: fixed; bottom: 1.5rem; width: 100%; text-align: center;
  font-size: 0.75rem; color: rgba(255,255,255,0.15); pointer-events: none;
}

/* Responsive */
@media (max-width: 900px) {
  .app-wrapper { grid-template-columns: 1fr; gap: 3rem; }
  .iphone-15 { width: 300px; height: 620px; } /* Scale down for mobile */
  body { padding: 1rem; padding-bottom: 3rem; }
  .control-panel { padding: 1.5rem; }
}

.status-text { text-align: center; font-size: 0.8rem; margin-top: 10px; }
.status-text.error { color: #ef4444; }
.status-text.success { color: #10b981; }
.status-text.info { color: #6366f1; }
