/* --- BASE STYLES --- */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #FAFAFA;
  color: #333333;
  line-height: 1.6;
}

header { text-align: center; padding: 20px; }

.main-column {
  max-width: 800px;
  margin: auto;
  padding: 15px;
  box-sizing: border-box; /* Ensures padding doesn't add to width */
}

/* --- 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; /* Prevents large banners from pushing screen width */
}

.ad-banner iframe {
  max-width: 100%; /* Scales banner to fit screen */
  height: auto;
}

/* --- CONVERTER FORM (Responsive) --- */
.converter-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

input[type="file"], select, #convertBtn {
  width: 100%; /* Full width on mobile by default */
  max-width: 400px; /* Limits size on desktop */
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 1rem;
  box-sizing: border-box;
}

button#convertBtn {
  background: #22c55e;
  color: white;
  cursor: pointer;
  font-weight: bold;
  border: none;
  transition: background 0.2s;
}

button#convertBtn:hover { background: #16a34a; }
button#convertBtn:disabled { background: #cbd5e1; cursor: not-allowed; }

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

.instructions {
  background: #f8f9fa;
  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;
}

/* --- FULL-SCREEN POPUP (Responsive) --- */
/* The semi-transparent background overlay */
/* 1. The Full-Screen Dark Overlay */
.popup-ad {
    display: none; /* Controlled by JS */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85); /* Darken everything behind */
    z-index: 99999; /* Stay above ads and headers */

    /* This is the magic for centering */
    justify-content: center;
    align-items: center;
}

/* 2. The Actual White Box */
.popup-content {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 380px; /* Big enough for the 300px ad + padding */
    text-align: center;
    position: relative; /* For the close button */
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
}

/* 3. Ensure the Ad is centered inside the white box */
.crypto-ad-slot {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

/* Close button positioning */
.close-ad {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    color: #333;
}

/* --- LOGO --- */
.logo {
  width: 100%;
  max-width: 150px;
  height: auto;
}

/* --- 📱 MOBILE RESPONSIVE QUERIES --- */

/* For Tablets and Small Desktops (Hide side ads if they overlap content) */
@media (max-width: 1150px) {
  .side-ad { display: none; }
}

/* For Standard Mobile Phones */
@media (max-width: 600px) {
  .main-column { padding: 10px; }

  /* Stack the instruction tiers vertically */
  .tier-item {
    grid-template-columns: 1fr;
    gap: 4px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
  }

  .ad-banner {
    display: flex;
    justify-content: center;
  }

  /* Make the font slightly smaller for mobile */
  .instructions { font-size: 0.85rem; }

  /* Ensure the converter form takes full width */
  input[type="file"], select, #convertBtn {
    width: 100%;
    margin: 5px 0;
  }
}