/* --- 🏠 GLOBAL & TOOL STYLES --- */
:root {
  --fc-blue: #007bff;
  --fc-blue-hover: #0069d9;
  --fc-green: #22c55e;
  --fc-text-dark: #1e293b;
  --fc-text-light: #64748b;
  --fc-card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --fc-border: #e2e8f0;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f8fafc;
  color: var(--fc-text-dark);
  line-height: 1.6;
}

/* --- 📢 ADS POSITIONING --- */
.side-ad {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
}
.left-ad { left: 10px; }
.right-ad { right: 10px; }

.ad-banner {
  text-align: center;
  margin: 20px 0;
  overflow: hidden;
}

.ad-banner iframe {
  max-width: 100%;
  height: auto;
}

@media (max-width: 1300px) {
  .side-ad { display: none !important; }
}

/* --- 🔥 HERO --- */
.hero {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--fc-border);
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #5B5D5B;
  margin-bottom: 10px;
}

.hero p {
  font-size: 1.1rem;
  color: var(--fc-text-light);
}

/* --- 🛠️ MAIN CONVERTER CARD --- */
.main-column {
  width: 95%; /* Add this to keep it inside the screen on mobile */
  max-width: 900px;
  margin: -30px auto 60px;
  background: #ffffff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: var(--fc-card-shadow);
  border: 1px solid var(--fc-border);
  box-sizing: border-box; /* This is good, keep it! */
}

/* --- 📥 DROPZONE / DROP-AREA --- */
.drop-area {
  border: 2px dashed #cbd5e1;
  padding: 50px 20px;
  border-radius: 12px;
  background: #fbfcfe;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.drop-area:hover {
  border-color: var(--fc-blue);
  background: #f0f7ff;
}

.drop-area p {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fc-text-dark);
  margin-bottom: 4px;
}

/* --- ⚙️ CONVERTER FORM & BUTTONS --- */
.converter-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-top: 25px;
}

input[type="file"], select {
  width: 100%;
  max-width: 400px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 1rem;
}

button#convertBtn {
  background: var(--fc-blue);
  color: white;
  padding: 16px 40px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px 0 rgba(0, 123, 255, 0.39);
  transition: all 0.2s ease;
  min-width: 260px;
}

button#convertBtn:hover:not(:disabled) {
  background: var(--fc-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.23);
}

button#convertBtn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  box-shadow: none;
}

/* --- 📝 INSTRUCTIONS & GRID --- */
.instructions-container {
  max-width: 600px;
  margin: 25px auto;
}

.instructions {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  font-size: 0.9rem;
  color: #495057;
}

.tier-grid {
  display: grid;
  gap: 15px;
}

.tier-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: flex-start;
}

/* --- 🖼️ CANVAS & COLOR PICKER --- */
#canvasContainer {
    margin-top: 20px;
    position: relative;
    cursor: crosshair;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    overflow-y: auto;
    display: none;
    max-height: 500px;
}

#colorCanvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}



/* --- 📄 CODE & UTILS --- */
pre {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 25px;
    border-radius: 8px;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.btn-secondary {
    background: #f1f5f9;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #cbd5e1;
}

/* --- 📱 MOBILE QUERIES --- */
@media (max-width: 600px) {
  .main-column { padding: 20px; margin-top: 10px; }
  .hero h1 { font-size: 1.8rem; }
  .tier-item {
    grid-template-columns: 1fr;
    gap: 4px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
  }
}

html, body {
  overflow-x: hidden;
  width: 100%;
  margin: 0;
  padding: 0;
}