/* ========================================
   ADMIN STYLES
   ======================================== */

.cookie-category-admin {
  margin-bottom: 20px;
  border: 1px solid #e5e5e5;
  box-shadow: 0 1px 1px rgb(0 0 0 / 4%);
  background: #fff;
}

.cookie-category-admin .hndle {
  margin: 0;
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  line-height: 1.4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f9f9f9;
}

.cookie-category-admin .inside {
  padding: 15px;
}

.cookie-list,
.scripts-list {
  margin-top: 15px;
  margin-bottom: 20px;
}

.add-cookie,
.add-script {
  margin-top: 10px;
}

.add-category-wrap {
  margin-top: 20px;
  margin-bottom: 20px;
}

.cookie-category-admin h4 {
  margin-top: 25px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}

/* ========================================
   ADMIN: ICON POSITION SETTING
   ======================================== */

.cookie-icon-position-setting {
  margin: 30px 0;
  padding: 20px;
  background-color: #f9f9f9;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
}

.cookie-icon-position-setting h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 600;
}

.cookie-icon-position-setting p {
  margin-bottom: 15px;
  color: #666;
}

.position-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.position-options label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fff;
  transition: background-color 0.2s;
}

.position-options label:hover {
  background-color: #f5f5f5;
}

.position-options input[type="radio"] {
  margin-right: 10px;
}

/* ========================================
   ADMIN: SCRIPT DETAILS
   ======================================== */

.script-details {
  margin-top: 10px;
  padding: 10px;
  background-color: #f9f9f9;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
}

.script-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.script-details label {
  display: block;
  margin-bottom: 5px;
}

.cookie-script-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.script-type-badge {
  background-color: #f0f0f0;
  color: #333;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 12px;
  text-transform: uppercase;
}

@media screen and (max-width: 992px) {
  .script-controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media screen and (max-width: 768px) {
  .script-controls {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   FRONTEND: INLINE COOKIE BANNER
   gov.uk-style — in normal document flow
   ======================================== */

.ccm-cookie-banner {
  background-color: var(--ccm-bg, #f3f2f1);
  border-bottom: 1px solid #b1b4b6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #0b0c0c;
  position:relative;
  z-index:999;
}

.ccm-cookie-banner[hidden] {
  display: none;
}

.ccm-cookie-banner__inner {
  margin: 0 auto;
  padding: 20px 16px;
}

.ccm-cookie-banner__message[hidden] {
  display: none;
}

.ccm-cookie-banner__heading {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px;
  color: #0b0c0c;
}

.ccm-cookie-banner__body {
  margin-bottom: 16px;
}

.ccm-cookie-banner__body p {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.5;
}

.ccm-cookie-banner__body p:last-child {
  margin-bottom: 0;
}

.ccm-cookie-banner__buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.ccm-cookie-banner__button {
  display: inline-block;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 0;
}

.ccm-cookie-banner__button:focus {
  outline: 3px solid #fd0;
  outline-offset: 0;
  box-shadow: inset 0 0 0 1px #fd0;
}

.ccm-cookie-banner__button--accept {
  background-color: var(--ccm-btn, #00703c);
  color: var(--ccm-btn-text, #fff);
}

.ccm-cookie-banner__button--accept:hover {
  background-color: var(--ccm-btn, #00703c);
  filter: brightness(0.85);
}

.ccm-cookie-banner__button--reject {
  background-color: var(--ccm-btn, #00703c);
  color: var(--ccm-btn-text, #fff);
}

.ccm-cookie-banner__button--reject:hover {
  background-color: var(--ccm-btn, #00703c);
  filter: brightness(0.85);
}

.ccm-cookie-banner__button--hide {
  background-color: transparent;
  color: #0b0c0c;
  border-color: #0b0c0c;
}

.ccm-cookie-banner__button--hide:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.ccm-cookie-banner__link {
  display: inline-block;
  color: #1d70b8;
  font-size: 16px;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 0.1em;
}

.ccm-cookie-banner__link:hover {
  color: #003078;
}

.ccm-cookie-banner__link:focus {
  outline: 3px solid #fd0;
  outline-offset: 0;
  background-color: #fd0;
  color: #0b0c0c;
  text-decoration: none;
  box-shadow: 0 -2px #fd0, 0 4px #0b0c0c;
}

.ccm-cookie-banner__confirmation {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.5;
}

.ccm-cookie-banner__confirmation a {
  color: #1d70b8;
  text-decoration: underline;
  text-underline-offset: 0.1em;
}

.ccm-cookie-banner__confirmation a:hover {
  color: #003078;
}

.ccm-cookie-banner__confirmation a:focus {
  outline: 3px solid #fd0;
  outline-offset: 0;
  background-color: #fd0;
  color: #0b0c0c;
  text-decoration: none;
  box-shadow: 0 -2px #fd0, 0 4px #0b0c0c;
}

/* ========================================
   COOKIE PREFERENCES FOOTER LINK
   ======================================== */

.ccm-cookie-footer-link {
  text-align: center;
  padding: 12px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 14px;
}

.ccm-cookie-footer-link a {
  color: #505a5f;
  text-decoration: underline;
  text-underline-offset: 0.1em;
}

.ccm-cookie-footer-link a:hover {
  color: #0b0c0c;
}

.ccm-cookie-footer-link a:focus {
  outline: 3px solid #fd0;
  outline-offset: 0;
  background-color: #fd0;
  color: #0b0c0c;
  text-decoration: none;
  box-shadow: 0 -2px #fd0, 0 4px #0b0c0c;
}

/* ========================================
   COOKIE SETTINGS PAGE (shortcode)
   ======================================== */

.cookie-categories {
  margin-bottom: 30px;
}

.cookie-category {
  margin-bottom: 15px;
  border: none;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 1rem;
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.cookie-category-title-wrap {
  display: flex;
  flex: 1;
}

.cookie-category-checkbox {
  margin-right: 10px;
}

.cookie-category-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.cookie-category-toggle {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: #666;
  transition: transform 0.2s;
  padding: 5px 10px;
}

.cookie-category.expanded .cookie-category-toggle .toggle-icon {
  display: inline-block;
  transform: rotate(180deg);
}

.cookie-category-content {
  padding: 0 15px;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.cookie-category.expanded .cookie-category-content {
  max-height: 1000px;
  padding: 15px;
  border-top: 1px solid #e0e0e0;
}

.cookie-category-description {
  margin-bottom: 20px;
}

.cookie-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.cookie-table th,
.cookie-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.cookie-table th {
  font-weight: 600;
  background-color: #f5f5f5;
}

.cookie-table caption.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media screen and (max-width: 768px) {
  .ccm-cookie-banner__buttons {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-table {
    font-size: 12px;
  }

  .cookie-table th,
  .cookie-table td {
    padding: 8px 5px;
  }
}
