/* Facebook Image Resizer - Complete Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f3f4f6;
  color: #111827;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  min-height: 100vh;
}

.ad-banner-top {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 15px;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ad-top-banner {
  width: 728px;
  height: 90px;
}

.ad-placeholder {
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  color: #9ca3af;
  font-size: 0.9rem;
  padding: 12px 20px;
  border-radius: 999px;
}

.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  flex: 1;
}

.nav {
  margin-bottom: 24px;
}

.nav a {
  color: #6b7280;
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.nav a:hover {
  color: #111827;
}

.header {
  text-align: center;
  margin-bottom: 32px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e5f2ff;
  color: #1d4ed8;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.logo-wordmark {
  font-weight: 700;
  letter-spacing: -0.06em;
}

h1 {
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 6px;
}

.subtitle {
  color: #4b5563;
  font-size: 0.95rem;
  max-width: 520px;
  margin: 0 auto;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
  padding: 20px 20px 18px;
}

.card h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-sub {
  color: #6b7280;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.upload-area {
  border: 1px dashed #cbd5f5;
  border-radius: 14px;
  padding: 18px;
  background: #f9fafb;
  text-align: center;
}

.upload-area input[type="file"] {
  display: none;
}

.upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #111827;
  color: #f9fafb;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.16s ease;
}

.upload-label:hover {
  background: #1f2937;
  transform: translateY(-1px);
}

.upload-helper {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #6b7280;
}

.original-preview {
  margin-top: 16px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  max-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.original-preview img {
  max-width: 100%;
  max-height: 260px;
  display: block;
}

.sliders {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-row label {
  flex: 0 0 90px;
  font-size: 0.8rem;
  color: #4b5563;
}

.slider-row input[type="range"] {
  flex: 1;
}

.helper-note {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 6px;
}

.formats-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.formats-header p {
  color: #6b7280;
  font-size: 0.8rem;
}

.formats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 900px) {
  .formats-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.format-card {
  background: #f9fafb;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.format-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #4b5563;
}

.format-name {
  font-weight: 600;
  color: #111827;
}

.format-desc {
  font-size: 0.75rem;
  color: #6b7280;
}

.format-canvas-wrapper {
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #111827;
  position: relative;
}

canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.safe-overlay {
  position: absolute;
  inset: 12%;
  border: 1px dashed rgba(249, 250, 251, 0.6);
  pointer-events: none;
}

.download-btn {
  margin-top: 8px;
  font-size: 0.8rem;
  padding: 7px 10px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #111827;
  color: #f9fafb;
  align-self: flex-start;
  transition: all 0.16s ease;
}

.download-btn:hover:not(:disabled) {
  background: #1f2937;
  transform: translateY(-1px);
}

.download-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.footer-note {
  margin-top: 18px;
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: right;
}

.ad-banner-bottom {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 20px;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 32px;
}

.footer {
  margin-top: 16px;
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
}