/* 
  OK Ads - Ad Generator
  Copyright (C) 2025 QVLX LLC

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/
html, body {
  overflow-x: hidden;
}

body {
  font-family: sans-serif;
  padding-left: 2em;
  padding-right: 2em;
  background: #c4c3d0;
  text-align: center;
}

h1 {
  font-size: 3rem;
}

h2 {
  margin: 0 auto;
  padding: 0px;
}

h1, h2, h3, h4 {
  color: #393952;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f4f0ec;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  body {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
  }

  form {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
}

.container.form-collapsed {
  padding-bottom: 0px;
}

form {
  display: grid;
  gap: 1em;
  max-width: 400px;
}

#formContainer {
  padding-top: 1em;
}

input, select, button {
  font-size: 0.7em;
  padding: 0.4em;
  width: 100%;
  box-sizing: border-box;
}

label {
  display: flex;
  flex-direction: column;
}

#codeBlock {
  white-space: pre-wrap;
  background: #f4f4f4;
  border-radius: 6px;
}

iframe#adPreview, iframe#previewFrame {
  display: block;
  margin-left: auto;
  margin-right: auto;
  background: black;
}

.dim-controls {
  display: flex;
  justify-content: space-between;
  gap: 0.5em;
}
.dim-controls label {
  flex: 1;
  font-size: 0.9em;
}

.padding-controls,
.font-controls {
  display: flex;
  justify-content: space-between;
  gap: 0.5em;
}

.padding-controls label,
.font-controls label {
  flex: 1;
  font-size: 0.8em;
}

.font-layout-controls {
  display: flex;
  justify-content: space-between;
  gap: 1em;
}

.font-layout-controls label {
  flex: 1;
  font-size: 0.8em;
}

.image-controls {
  display: flex;
  justify-content: space-between;
  gap: 0.5em;
}

.image-controls label {
  flex: 1;
  font-size: 0.8em;
}

.control-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5em;
}

.control-row label {
  flex: 1;
  font-size: 0.8em;
}

#toggleFormBtn {
  padding: 0.4em 0.8em;
  font-size: 0.9em;
  cursor: pointer;
}

#formContainer.collapsed {
  display: none;
}

#copyBtn:hover {
  cursor: pointer; 
}

.buttonribbon {
  display: flex;
  gap: 0.5em;
  margin-bottom: 1em;
  margin-top: 1em;
}

#codeContainer {
  display: flex;
  justify-content: center;
  width: 100%;
}

#codeContainer.collapsed {
  display: none;
}

#toggleCodeBtn {
  padding: 0.4em 0.8em;
  font-size: 0.9em;
  cursor: pointer;
}

.okad-box {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  z-index: 0;
}

.okad-box,
.okad-cta {
  position: relative;
  border-radius: 12px;
  z-index: 0;
  isolation: isolate;
}

.okad-box::before,
.okad-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 3px;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    red,
    orange,
    yellow,
    lime,
    cyan,
    blue,
    purple,
    red
  );
  background-size: 600% 100%;
  background-position: 0% 50%;
  animation: borderShift 2s ease-in-out forwards;
  animation-fill-mode: forwards;

  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;

  pointer-events: none;
  z-index: -1;
  opacity: 1;
}

@keyframes borderShift {
  0% {
    background-position: 0% 50%;
    opacity: 1;
  }
  50% {
    background-position: 100% 50%;
    opacity: 1;
  }
  100% {
    background-position: 0% 50%;
    opacity: 0;
  }
}

.no-border-anim .okad-box::before,
.no-border-anim .okad-cta::before {
  animation: none !important;
}

#emailModal {
  display: block; 
}

.titlewrap {
  max-width: 100%;
  justify-content: center;
  display: flex;
  padding: 0px;
  margin: 0 auto;
}

.okad-cta {
  justify-content: center;
  width: fit-content;
  height: fit-content;
  position: relative;
  font-weight: bold;
  padding: 0.2em .6em;
  border: none;
  border-radius: 8px;
  background: none;
  z-index: 0;
  cursor: pointer;
  overflow: hidden;
  margin: 0 auto;
}

h1 {
  color: #25253D; 
}

#info {
  margin-top: 2.4rem;
  color: #4E4E52;
}

#sign, #signlink {
  color: #353839;
  margin-top: 2px;
}


#codeContainer.collapsed {
  display: none;
}

#previewContainer.collapsed {
  display: none;
}

#previewToggle {
  user-select: none;
}

#togglePreviewBtn {
  padding: 0.4em 0.8em;
  font-size: 0.9em;
  cursor: pointer;
}