/* Variables */
:root {
    --light-turquoise: #00d3e3;
    --main-turquoise: #008392;
    --border-color-gray: #8c8f94;
    --border-color-gray-inner-text: #555d66;
    --progress-no-padding-red: #ea4335;
    --progress-no-padding-yellow: #fbbc05;
    --progress-no-padding-green: #34a853;
}

/* Metabox Header with Credits */
.aysa-metabox-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.aysa-metabox-header h2 {
    margin: 0;
    font-size: 16px;
    color: #1d2327;
}

.aysa-metabox-credits {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 4px 8px;
}

.aysa-metabox-credits .aysa-credits-component {
    font-size: 12px;
    color: #666;
    margin: 0;
}

.aysa-metabox-credits .aysa-credits-value {
    font-weight: 500;
}

.aysa-metabox-credits .aysa-credits-amount {
    color: var(--main-turquoise);
    font-weight: 600;
}

.aysa-metabox-credits .aysa-loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--main-turquoise);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.aysa-metabox-credits .aysa-credits-fallback {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    margin: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility */
.btn {
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
}

.btn-universal {
    background-color: var(--light-turquoise);
    color: #fff;
}

.btn-universal:hover {
    background-color: var(--main-turquoise);
}

.btn-accept {
    background-color: #008392;
    color: #fff;
}

.btn-accept:hover {
    background-color: #006d7b;
}

.spinner {
    display: none;
    float: none;
    visibility: visible;
    margin-left: 5px;
    vertical-align: middle;
}

.spinner.is-active {
    display: inline-block;
}

/* Form elements */
.label-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.label-container {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.label-container label {
    margin-right: 5px;
}

.tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
}

.tooltip i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background-color: #ccc;
    border-radius: 50%;
    font-style: normal;
    color: #fff;
    font-size: 10px;
    cursor: pointer;
}

.tooltip-content {
    display: none;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 200px;
    z-index: 1;
}

.tooltip:hover .tooltip-content {
    display: block;
}

/* Progress bar */
.bar-container {
    margin-top: 5px;
}

.progress-container {
    width: 100%;
    height: 5px;
    background-color: #eee;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.progress-container.no-padding {
    margin: 0;
}

.progress-bar {
    height: 100%;
    background-color: var(--progress-color, var(--main-turquoise));
    width: var(--percentage, 0%);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.percentage {
    position: absolute;
    right: 0;
    top: -3px;
    font-size: 10px;
    color: var(--percentage-color, var(--main-turquoise));
}

/* Metabox */
#custom_product_meta_box {
    border-radius: 10px;
}

#custom_product_meta_box .inside {
    padding: 0;
}

#custom_product_meta_box .panel {
    display: none;
}

#custom_product_meta_box .panel.active {
    display: block;
}

#custom_product_meta_box .inner-box {
    padding: 15px 20px;
    border-bottom: .5px solid rgba(0, 0, 0, 0.15);
}

#custom_product_meta_box .inner-box:last-child {
    border-bottom: none;
}

#custom_product_meta_box .inner-box.text-box h3 {
    font-size: 15px;
    font-weight: 500;
    margin: 0.5rem 0;
}

#custom_product_meta_box .inner-box .group h3 {
    margin: 0 0 10px 0;
    font-size: 15px;
}

#custom_product_meta_box .inner-box.text-box span {
    color: var(--border-color-gray);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 14px;
}

/* Metabox Tabs */
#custom_product_meta_box .tabs {
    display: flex;
    flex-direction: row;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid #ddd;
    width: 100%;
}

#custom_product_meta_box .tabs li {
    margin-right: 20px;
    padding: 10px 15px;
    position: relative;
    cursor: pointer;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

#custom_product_meta_box .tabs li:hover {
    color: var(--main-turquoise);
}

#custom_product_meta_box .tabs li.active {
    color: var(--main-turquoise);
    border-bottom-color: var(--light-turquoise);
}

/* Add hand cursor to make it clear tabs are clickable */
#custom_product_meta_box .tabs li {
    cursor: pointer;
}

/* Style the tab container to be on the same line as the Get SEO button */
#custom_product_meta_box .inner-box:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Make sure the tabs take up most of the space */
#custom_product_meta_box .tabs {
    flex: 1;
}

/* Hide all panels by default */
#custom_product_meta_box .panel {
    display: none;
}

/* Show only active panel */
#custom_product_meta_box .panel.active {
    display: block;
}

#custom_product_meta_box .inner-box .meta-group {
    margin-bottom: 20px;
    color: var(--border-color-gray-inner-text);
    max-width: 100%;
}

#custom_product_meta_box .inner-box .meta-group.track-keywords {
    margin-left: 0;
}

#custom_product_meta_box .meta-group.robots-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 10px;
    margin-bottom: 20px;
}

#custom_product_meta_box .seo-settings {
    display: flex;
    flex-flow: column;
    align-items: flex-start;
    width: 100%;
}

#custom_product_meta_box .seo-settings .form-group {
    width: 100%;
    margin-bottom: 15px;
}

.search-input-container {
    position: relative;
    width: 100%;
}

.search-input-container input {
    width: 100%;
    padding: 8px 12px;
    padding-right: 30px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-input-container::after {
    content: "\f179";
    font-family: dashicons;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

.form-group {
    margin-bottom: 15px;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Style all checkbox inputs in the form consistently */
input[type="checkbox"].custom-radio {
    position: relative;
    margin-right: 10px;
}

/* Ensure advanced tab form groups align properly */
#custom_product_meta_box .panel[data-panel="advanced"] .form-group {
    max-width: 400px;
    margin-bottom: 20px;
}

/* Add space between the robots meta section and advanced robots meta */
#custom_product_meta_box .panel[data-panel="advanced"] h3 {
    margin-top: 25px;
    margin-bottom: 15px;
}

/* First h3 in a panel should not have large top margin */
#custom_product_meta_box .panel[data-panel="advanced"] h3:first-of-type {
    margin-top: 0;
}

#custom_product_meta_box .custom-select label {
    padding: 10px;
}

.seo-suggestion-wrapper {
    display: inline;
    position: relative;
}

.seo-suggestion-btn {
    display: inline;
    margin-left: 10px;
    line-height: 2;
    text-decoration: none;
    padding: 5px 10px;
}

.seo-suggestion-btn:hover, .seo-suggestion-btn:active,.seo-suggestion-btn:focus {
    color: white;
}

.page-title-action + .seo-suggestion-wrapper {
    top: -3px;
}

.seo-suggestion-wrapper dialog[open] {
    display: flex;
    z-index: 9999;
    border: 1px solid var(--border-color-gray);
    border-radius: 8px;
}

.seo-suggestion-wrapper dialog .close {
    margin-left: 20px;
    font-weight: bold;
    font-size: 20px;
    line-height: 1;
}

.seo-suggestion-wrapper dialog .close:hover {
    cursor: pointer;
}

.category_box h2 {
    font-size: 16px;
    margin: 0;
    padding: 15px 20px;
}

/* Meta form */
.meta-form {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.meta-form input[type="checkbox"],
.meta-form input[type="radio"] {
    margin-right: 8px;
}

/* Sub group */
.sub-group {
    margin-bottom: 20px;
    position: relative;
}

.sub-group .actions {
    margin-top: 10px;
}

/* Custom radio and checkbox */
.custom-radio {
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.15em;
    height: 1.15em;
    border: 0.15em solid #757575;
    border-radius: 50%;
    transform: translateY(-0.075em);
    display: grid;
    place-content: center;
}

.custom-radio::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    border-radius: 50%;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--light-turquoise);
}

.custom-radio:checked::before {
    transform: scale(1);
}

/* New category form */
#custom_product_meta_box_new {
    margin-top: 20px;
    background: #fff;
    padding: 15px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
} 