/**
 * aw-admin.css
 *
 * Enthält alle CSS-Regeln, die für die Wordpress Admin Page notwendig sind.
 */

/* Plugin Color */
:root {
  --plugin-color: #000000;
}

:root {
  --plugin-accent-color: #27FF27;
}

  /* Reduce the icon size in the admin menu */
  #toplevel_page_aw-settings .wp-menu-image img {
    width: 18px !important;
    height: 18px !important;
    object-fit: contain;
}

/* Externe Button */
.aw-external-btn {
  background: var(--plugin-color);
}

.aw-toggle-active {
  background: var(--plugin-color) !important;
}
.aw-design-option.active,
.aw-position-option.active {
  border-color: var(--plugin-color) !important;
}

/* Design-Auswahl: aktiver Rahmen */
.aw-design-option.active,
.aw-position-option.active {
  border-color: var(--plugin-color);
}

/* Positions-Box: Beispielhafte Darstellung */
.aw-position-option {
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
}

/* Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 25px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 25px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 21px;
  width: 21px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--plugin-color) !important;
}
input:checked + .slider:before {
  transform: translateX(25px) !important;
}

/* Style für den Submit Button als Pill mit Plugin Accent Color */
input[type=submit].button-primary,
.button-primary {
  background: var(--plugin-color) !important;
  border: none !important;
  border-radius: 50px !important;
  color: #fff !important;
  padding: 5px 20px !important;
  margin-top: -10px;
}

/* Style für die Submit-Nachricht */
.updated.notice {
  border-radius: 5px;
  background-color: #CEFFDB !important; 
  Border-color: #00A52C !important;
}

/* Inline Styles*/

/* Grundlayout */
.aw-admin-wrapper {
  display: flex;
  width: 98.5%;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 25px;
}

.aw-admin-container {
  background: #fff;
  border-radius: 12px;
  flex: 1;
  margin: 25px 25px 30px 5px;
  padding: 0;
}

#aw-license-sidebar {
  background: #fff;
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 8px;
  width: 300px;
  margin-top: 25px;
  position: sticky;
  top: 25px;
}

/* Header */
.aw-header {
  background: var(--plugin-color);
  height: 100px;
  display: flex;
  align-items: center;
  border-radius: 12px 12px 0 0;
  padding: 20px;
}

.aw-header-logo {
  max-height: 50px;
}

/* Admin Content */
.aw-admin-content {
  padding: 20px;
  text-align: left;
  color: #555;
}

.aw-admin-container h1,
.aw-admin-content h1 {
  text-align: left;
  margin-bottom: 10px;
  line-height:1.3;
}

.updated.notice {
  margin: 20px 0;
  padding: 10px;
  border: 1px solid #00A52C;
  background: #CEFFDB;
  border-radius: 8px;
}

/* Sections */
.aw-section {
  margin: 30px 0;
  border: 1px solid #ddd;
  padding: 20px;
  border-radius: 8px;
}

/* Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--plugin-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Status Indicator */
.aw-status small {
  display: inline-block;
  margin-top: 10px;
}

.status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
}

.status-indicator.active {
  background: #27FF27;
}

.status-indicator.inactive {
  background: red;
}

/* Radio Options (Design, Position, Menu, Text) */
.aw-radio-options label {
  max-width:200px;
  cursor: pointer;
  border: 1px solid #ddd;
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 5px;
  display: block;
}

.aw-radio-options label.active {
  border-color: var(--plugin-color);
}

/* Layout für die Gruppen (Design, Position, Menü) */
.aw-design-options,
.aw-position-options,
.aw-menu-options {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.aw-radio-options {
  flex: 1;
  min-width: 150px;
}

.aw-design-image,
.aw-position-image,
.aw-menu-image {
  margin-left: 20px;
}

.aw-design-image img,
.aw-position-image img,
.aw-menu-image img {
  width: 250px;
}

/* Color Selection Preview */
#aw-color-preview-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  max-width: 45%;
  margin-left: 44%;
  border-radius: 8px;
}

#aw_preview_header {
  background: var(--plugin-accent-color, #ff0000);
  color: #000;
  padding: 4px;
  border-radius: 8px 8px 0 0;
  text-align: center;
  font-weight: bold;
}

#aw_preview_body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 10px;
  background: #EDEDED;
}

#aw_preview_body div {
  background: #fff;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 4px;
}

#aw_preview_footer {
  background: var(--plugin-accent-color, #ff0000);
  height: 15px;
  border-radius: 0 0 8px 8px;
}

/* Custom Icon Preview */
#aw_icon_preview_container {
  margin-bottom: 10px;
  width: 35px;
  height: 35px;
  padding: 5px;
  background-color: var(--plugin-accent-color, #ff0000);
  border-radius: 50px; /* Wird per JS dynamisch angepasst */
  display: flex;
  justify-content: center;
  align-items: center;
}

#aw_icon_preview_container img {
  max-width: 25px;
  max-height: 25px;
}

/* Exclude Pages */
.aw-page-tag {
  display: inline-block;
  background: var(--plugin-color);
  color: #fff;
  padding: 5px 10px;
  border-radius: 15px;
  margin-right: 5px;
  margin-bottom: 5px;
  cursor: pointer;
}

.aw-remove-tag {
  margin-left: 5px;
  cursor: pointer;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
  .aw-admin-wrapper {
    flex-direction: column;
  }
  .aw-admin-container,
  #aw-license-sidebar {
    width: 100% !important;
    margin: 25px 0;
  }
  .aw-design-image img,
  .aw-position-image img,
  .aw-menu-image img {
    width: 150px !important;
  }
  #aw-color-preview-container {
    margin-left: 0 !important;
    max-width: 100% !important;
    margin-top: 10px;
  }
}

/* Wrapper und Container */
.aw-admin-wrapper {
  display: flex;
  width: 98.5%;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 25px;
}
.aw-admin-container {
  background: #fff;
  border-radius: 12px;
  flex: 1;
  margin: 25px 25px 30px 5px;
  padding: 0;
}

/* Sidebar */
#aw-license-sidebar {
  background: #fff;
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 8px;
  width: 300px;
  margin-top: 25px;
  position: sticky;
  top: 25px;
}
#aw_notice {
  margin: 20px 0;
  border-radius: 8px;
  padding: 10px;
  border: 1px solid #0073aa;
  background: #CEE5F0;
}
#aw-license-status {
  padding: 10px;
  text-align: center;
  border-radius: 50px;
  width: 40%;
  color: black;
  /* Der Rahmen und Background werden inline in der HTML gesetzt */
}

/* Header */
.aw-admin-container > .aw-header {
  background: var(--plugin-color);
  height: 100px;
  display: flex;
  align-items: center;
  width: auto;
  border-radius: 12px 12px 0 0;
  padding: 20px;
}

/* Responsive Anpassungen */
@media (max-width:768px) {
  .aw-admin-wrapper {
    flex-direction: column;
  }
  .aw-admin-container,
  #aw-license-sidebar {
    width: 100% !important;
    margin: 25px 0;
  }
  .aw-design-image img,
  .aw-position-image img,
  .aw-menu-image img {
    width: 150px !important;
  }
  #aw-color-preview-container {
    margin-left: 0 !important;
    max-width: 100% !important;
    margin-top: 10px;
  }
}

/* Switch Styles (wie im Original inline) */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--plugin-color);
}
input:checked + .slider:before {
  transform: translateX(26px);
}

/* Status-Indikator */
.aw-status small {
  display: inline-block;
  margin-top: 10px;
}
.status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
}
.status-indicator.active {
  background: #27FF27;
}
.status-indicator.inactive {
  background: red;
}

/* Radio Buttons & Auswahl-Optionen */
.aw-radio-options label {
  cursor: pointer;
  border: 1px solid #ddd;
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 5px;
  display: block;
  width: auto;
}
.aw-radio-options label.active {
  border-color: var(--plugin-color);
}
.aw-design-image,
.aw-position-image,
.aw-menu-image {
  margin-left: 20px;
}
.aw-design-image img,
.aw-position-image img,
.aw-menu-image img {
  width: 250px;
}

/* Color Preview Container (exakt wie im Original inline) */
#aw-color-preview-container {
  flex-grow: 1;
  max-width: 45%;
  margin-left: 44%;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}
#aw_preview_header {
  background: var(--plugin-accent-color, #ff0000);
  color: #000;
  height: auto;
  padding: 4px;
  border-radius: 8px 8px 0 0;
  text-align: center;
  font-weight: bold;
}
#aw_preview_body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 10px;
  background: #EDEDED;
}
#aw_preview_body div {
  background: #fff;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 4px;
}
#aw_preview_footer {
  background: var(--plugin-accent-color, #ff0000);
  height: 15px;
  border-radius: 0 0 8px 8px;
}

/* Custom Icon Preview */
#aw_icon_preview_container {
  margin-bottom: 10px;
  width: 35px;
  height: 35px;
  padding: 5px;
  background-color: var(--plugin-accent-color, #ff0000);
  border-radius: 50px; /* wird per JS ggf. angepasst */
  display: flex;
  justify-content: center;
  align-items: center;
}
#aw_icon_preview_container img {
  max-width: 25px;
  max-height: 25px;
}

/* PRO-Label (exakt wie Inline: Hintergrund, Padding, Border-Radius) */
.pro-label {
  background-color: #CEFFDB;
  border: 1px solid var(--plugin-accent-color);
  color: black;
  display: inline-block;
  padding: 2px 6px;
  margin-left: 0px;
  border-radius: 4px;
}

/* Input-Felder, Dropdowns – exakte Originalangaben */
.aw-admin-container input[type="text"],
.aw-admin-container input[type="color"],
.aw-admin-container select {
  border-radius: 0;
  padding: 8px;
}

/* Lizenzschlüssel Input – breiter, rund */
#aw_license_key {
  width: 100%;
  height: 40px;
  margin-bottom: -20px;
  border-radius: 25px;
  padding: 8px;
  box-sizing: border-box;
}

/* Dropdowns für Sprache und Exclude Pages */
.aw-admin-container select {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  box-sizing: border-box;
}

/* Branding Preview Bild */
.aw-branding-preview {
  max-width: 200px;
  max-height: 150px;
  margin-bottom: 20px;
}

/* Deregister License Button als Link */
.aw-deregister-btn {
  background: none;
  border: none;
  color: #0073aa;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* Allgemeine Formular-Stile */
.aw-admin-container form {
  margin: 0;
  padding: 0;
}

/* Demo Menü: 50% Breite, ohne Rahmen, mit Akzentfarbe als Hintergrund */
.demo-menu {
  width: 50%;
  border: none;
  background-color: var(--accent-color); /* Akzentfarbe, z.B. aus Theme-Variablen */
}

/* Farbfelder: Label oberhalb, fett, Rahmen entfernen */
.color-field {
  border: none; /* Rahmen entfernen */
}

.color-field label {
  display: block;
  font-weight: bold;
}
