#wpbody-content > h1 {
	position: relative;
    color: #1d2327;
    font-size: 2em;
    margin: 0;
    margin-left: -20px;
    background: #FFF;
    padding: 20px;
    border: 1px solid #c3c4c7;
}

div.notice {
    margin: 5px 20px 5px 0;
}

h2.nav-tab-wrapper {
	margin-top: 20px;
}
    
img.gptranslate-plugin-icon {
	width: 64px;
	height: 64px;
}

/* Labels */
.gpt-label {
	display: inline-block;
	padding: 2px 8px;
	font-size: 1em;
	font-weight: 600;
	color: #fff;
	background-color: #0073aa; /* WordPress blue */
	border-radius: 12px;
	vertical-align: middle;
	white-space: nowrap;
}

/* Success label */
.gpt-label-success {
	background-color: #46b450;
}

/* Danger label */
.gpt-label-danger {
	background-color: #dc3232;
}

/* Warning label */
.gpt-label-warning {
	background-color: #ffb900;
	color: #000;
}

/* Buttons */
.gpt-button {
	display: inline-block;
	padding: 6px 12px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	background-color: #0073aa;
	border: none;
	border-radius: 2px;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s;
}

.gpt-button:hover {
	background-color: #006799;
	text-decoration: none;
}

/* Button variants */
.gpt-button-danger {
	background-color: #dc3232;
}

.gpt-button-danger:hover {
	background-color: #b81b1b;
}

.gpt-button-success {
	background-color: #46b450;
}

.gpt-button-success:hover {
	background-color: #3ea145;
}

/* Table styling */
.gpt-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 20px;
}

.gpt-table th, .gpt-table td {
	padding: 8px 10px;
	border: 1px solid #ccc;
	text-align: left;
}

.gpt-table th {
	background-color: #f9f9f9;
	font-weight: 600;
}

.form-table th {
	vertical-align: top;
	text-align: left;
	padding: 20px 10px 10px 10px;
	width: 200px;
	line-height: 1.3;
	font-weight: 600;
	border-left: 1px solid #2271b1;
	border-left-width: 4px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

#tab-translator .form-table th {
	width: 280px;
}

.form-table td {
	box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

/* Edit record translation */
#wpfooter {
	display: none !important;
}

input[name=pagelink], input[name=translated_alias], div.gptcard {
	width: 60%;
}

@media ( max-width : 1024px) {
	input[name=pagelink], div.gptcard {
		width: 100%;
	}
}

div.accordion-body {
	max-height: 800px;
	overflow: auto;
}

/* Search */
div.gptcard-header button, div.gptcard-header input {
	font-weight: normal;
	white-space: nowrap;
}

/* Sort dropdown */
.gpt-sort-select {
	padding: 4px 8px;
	font-size: 13px;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	background: #fff;
	color: #2c3338;
	cursor: pointer;
	height: 30px;
	margin-left: 4px;
}

.gpt-sort-select:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}

input[name=search] {
	width: 50%;
}

/* Container */
form.form-filter-container {
	display: flex;
	justify-content: space-between;
	margin-bottom: 10px;
	position: relative;
}

div.right-filter-container input[type="submit"] {
	margin: 0 1px;
}

.translations-container {
	max-width: 100%;
	padding: 1rem;
	font-family: sans-serif;
}

*.doublesize-icon {
	font-size: 18px;
	font-weight: 700;
	margin-left: 5px;
}

#search-input {
	min-width: 300px;
	margin-right: 2px;
}

#search-input+button,
#search-input+button+button {
	margin-right: 2px;
}

/* Card */
.gptcard {
	border: 1px solid #ddd;
	border-radius: 6px;
	margin-bottom: 1rem;
	background-color: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Card header */
.gptcard-header {
	background-color: #f5f5f5;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #ddd;
	font-weight: bold;
}

.gptcard-header [data-role="search-translations"],
.gptcard-header [data-role="reset-search"] {
	white-space: nowrap;
	font-weight: normal;
}

/* Accordion toggle area */
.accordion-toggle {
	display: flex;
	align-items: center;
	gap: 1rem;
}

/* Input group */
.input-group {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: nowrap;
	width: 100%;
}

.input-group-text {
	background-color: #e9ecef;
	padding: 0.5rem 0.75rem;
	border-radius: 4px;
	font-size: 0.875rem;
}

#migraterow span.input-group label {
	white-space: nowrap;
}

table.widefat input.form-check-input {
	margin: 0;
}

/* Card body */
.gptcard-body {
	padding: 1rem;
}

div.translation-row.translation-row-hidden {
	display: none;
}

/* Buttons */
.btn {
	display: inline-block;
	padding: 0.375rem 0.75rem;
	border-radius: 2px;
	border: none;
	font-size: 0.875rem;
	cursor: pointer;
}

.btn-sm {
	font-size: 0.75rem;
	padding: 0.25rem 0.5rem;
}

.btn-primary {
	background-color: #2271b1;
	color: white;
}

.btn-success {
	background-color: #198754;
	color: white;
}

.btn-danger {
	background-color: #dc3545;
	color: white;
}

.btn-warning {
	background-color: #ffc107;
	color: black;
}

span.icon-refresh {
	display: inline-block;
}

button.group-sync.btn-invisible {
	display: none;
}

button.group-sync span.icon-refresh.icon-working {
	animation: spin 2s infinite linear;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Badges */
.badge {
	display: inline-block;
	padding: 0.35em 0.65em;
	font-size: 1em;
	font-weight: 600;
	border-radius: 3px;
	margin-bottom: 0.25rem;
}

/* Colori di stato */
.bg-primary {
	background-color: #2271b1;
	color: #FFFFFF;
}

.bg-success {
	background-color: #28a745;
	color: #FFFFFF;
}

.bg-danger {
	background-color: #dc3545;
	color: #FFFFFF;
}

.bg-warning {
	background-color: #ffc107;
	color: #212529;
}

.bg-info {
	background-color: #17a2b8;
	color: #FFFFFF;
}

/* Zero state */
.gptranslate-zero-state {
	max-width: 720px;
	margin: 80px auto;
	padding: 40px;
	background: #ffffff;
	border-radius: 8px;
	border: 1px solid #e5e5e5;
	text-align: center;
}

.gptranslate-zero-title {
	font-size: 24px;
	font-weight: 600;
	margin-bottom: 10px;
}

.gptranslate-zero-icon {
	margin-bottom: 20px;
	opacity: 0.9;
}

.gptranslate-zero-desc {
	font-size: 15px;
	color: #555;
	margin-bottom: 30px;
}

.gptranslate-zero-hint {
	margin-top: 20px;
	font-size: 13px;
	color: #777;
}

#gptranslate-start-crawler span.dashicons-before::before {
	vertical-align: middle;
	margin-right: 10px;
}

/* Textarea */
.translation-row textarea {
	width: 198px;
	height: 60px;
}

/* Translation row */
.translation-row {
	padding-top: 1rem;
	margin-top: 1rem;
	display: flex;
	align-items: center;
	column-gap: 10px;
	align-items: center;
	position: relative;
}

.translation-row label.gpt-label.badge {
	position: absolute;
	right: 1px;
	top: 0;
	font-size: 12px;
}

/* Tooltips */
.custom-tooltip {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 9999;
	background: #333;
	color: #fff;
	padding: 6px 10px;
	font-size: 0.85em;
	border-radius: 4px;
	max-width: 250px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s ease;
	white-space: normal;
}

/* Settings with switchers */
a.nav-tab:focus {
	box-shadow: none;
}

.nav-tab-active, .nav-tab-active:focus, .nav-tab-active:focus:active, .nav-tab-active:hover {
	transition: border 0s;
}

div.tab-content > p:first-child,
div.tab-content > p:last-child {
	text-align: right;
	margin-right: 20px;
}

#config-gptranslate table.form-table {
	margin-top: -40px;
}

table.form-table th.settings-label-separator {
    border: none;
    background: #2271b1;
    color: #FFF;
    text-align: center;
    padding: 0;
    vertical-align: middle;
    border-left: 4px solid #2271b1;
}

table.widefat.fixed.striped a:focus {
	box-shadow: none;
}

table tr.alt_translations_0 {
	display: none;
}

/* API Key field with eye-toggle */
.gpt-apikey-wrap {
    display: flex;
    align-items: center;
    gap: 0;
}
.gpt-apikey-wrap .button {
    padding: 0 12px;
    height: 30px;
    line-height: 30px;
    flex-shrink: 0;
    background: #f6f7f7;
}
.gpt-apikey-wrap .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-top: 4px;
}

.gpt-apikey-wrap .dashicons.dashicons-visibility,
.gpt-apikey-wrap .dashicons.dashicons-hidden {
	line-height: normal;
}

.gpt-apikey-wrap .large-apikey {
	width: 50%;
}

.toggle-import {
	background: #FFF;
	padding: 4px 5px;
}

.wp-admin input[type=file] {
    border: 1px solid #CCC;
    border-radius: 4px;
    padding-left: 5px;
}

div.exportimportbtns {
	position: relative;
	display: flex;
	justify-content: flex-end;
    margin-top: -40px;
    column-gap: 5px;
    margin-right: 20px;
}

#add-repeatable-row {
	float: right;
}

#bulk-delete-btn, #toggle-migration {
	margin-right: 10px;
}

#migraterow {
	width: fit-content;
	margin-bottom: 10px;
	background: #FFF;
	padding: 5px 10px;
	border-radius: 4px;
}

#migraterow .input-group {
	width: auto;
	margin-right: 10px;
}

#migraterow .button {
	margin-right: 5px;
}

/* Pagination */
.tablenav-pages {
	margin-top: 20px;
}

.tablenav-pages .button {
	margin-bottom: 4px !important;
	margin-right: 5px;
	padding: 5px 10px;
	text-decoration: none;
}

.tablenav-pages .current-page {
	font-weight: bold;
	background-color: #0073aa;
	color: #fff;
}

div.action-buttons-toolbar {
	margin: 5px 0 10px;
}

input[name='import_file'] {
	margin-left: 5px;
}

#translations_json {
	display: none !important;
}

.wp-core-ui .button-warning,
.wp-core-ui .button-warning:focus,
.wp-core-ui .button-warning:active {
    background: #f15116;
    border-color: #d43900;
    color: #fff;
}

.wp-core-ui .button-warning:hover {
    background: #d43900;
    border-color: #d43900;
    color: #fff;
}

.wp-core-ui .button-warning.button-crawler {
    position: absolute;
    top: 40px;
    right: 0;
    box-shadow: none;
}

div.wrap:has(input.button-crawler) {
	position: relative;
}

div.wrap:has(#notranslations-notice) .button-warning.button-crawler {
    top: -60px;
}

@media (max-width: 782px) { 
	.wp-core-ui .button-warning.button-crawler {
	    top: 50px;
	}
}

@media (max-width: 1280px) { body.toplevel_page_gptranslate, body.gptranslate_page_gptranslate-settings { min-width: 1280px; overflow-x: auto }}

/* GPTranslate iOS switch */
.wrapper {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  vertical-align: middle;
  cursor: pointer;
}

.wrapper input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wrapper > label {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  cursor: pointer;
}
.wrapper > label:last-child {
  left: 50%;
}

.wrapper > label > span {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
}

.wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #bdbdbd;
  border-radius: 999px;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: inset 0 0 3px rgba(0,0,0,0.25);
  pointer-events: none;
}

.wrapper::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transition: transform 0.28s cubic-bezier(0.45,1.6,0.45,1), color 0.2s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  content: "";
}

.wrapper:has(> label:first-child > input:checked)::after {
  content: "✓";
  color: #2196f3;
}

.wrapper:has(> label:first-child > input:checked)::before {
  background: #2196f3;
  box-shadow: 0 0 0 3px rgba(33,150,243,0.18);
}
.wrapper:has(> label:first-child > input:checked)::after {
  transform: translateX(24px);
}

.wrapper:has(> label:last-child > input:checked)::before {
  background: #bdbdbd;
}
.wrapper:has(> label:last-child > input:checked)::after {
  transform: translateX(0);
}

.wrapper:hover::before {
  box-shadow: 0 0 0 3px rgba(33,150,243,0.12);
}
.wrapper input[type="radio"]:focus-visible + span {
  outline: 2px solid rgba(33,150,243,0.45);
  outline-offset: 2px;
}

/* Test API Key button */
#btn_test_apikey {
  margin: 4px 0 0 1px;
  vertical-align: middle;
  background: #f6f7f7;
}
#btn_test_apikey:disabled {
  opacity: 0.7;
  cursor: wait;
}
.icon-spin {
  animation: gpt-spin 1s linear infinite;
}
@keyframes gpt-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
#apikey_test_result {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 13px;
  vertical-align: middle;
  font-weight: 500;
}
.gpt-test-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
.gpt-test-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  max-width: 500px;
  word-break: break-word;
}

.gpt-field-error {
  border-color: #dc3232 !important;
  box-shadow: 0 0 0 1px #dc3232 !important;
}
.gpt-validation-error {
  display: block;
  color: #dc3232;
  font-size: 12px;
  margin-top: 4px;
  margin-left: 4px;
  margin-right: 4px;
}

.gpt-drag-over-before {
  border-top: 3px solid #2271b1;
  box-shadow: 0 -2px 6px rgba(34, 113, 177, 0.35);
}
.gpt-drag-over-after {
  border-bottom: 3px solid #2271b1;
  box-shadow: 0 2px 6px rgba(34, 113, 177, 0.35);
}

/* Targetta ogni body che ha una classe 'branch-' seguita da un numero >= 7 */
body[class*="branch-7"] .wrapper:has(> label:first-child > input:checked)::after,
body[class*="branch-8"] .wrapper:has(> label:first-child > input:checked)::after,
body[class*="branch-9"] .wrapper:has(> label:first-child > input:checked)::after {
	color: #3858e9;
}

body[class*="branch-7"] .wrapper:has(> label:first-child > input:checked)::before,
body[class*="branch-8"] .wrapper:has(> label:first-child > input:checked)::before,
body[class*="branch-9"] .wrapper:has(> label:first-child > input:checked)::before {
	background: #3858e9;
}

body[class*="branch-7"] table.form-table th.settings-label-separator,
body[class*="branch-8"] table.form-table th.settings-label-separator,
body[class*="branch-9"] table.form-table th.settings-label-separator  {
    background: #3858e9;
    border-left: 4px solid #3858e9;
}

body[class*="branch-7"] div.exportimportbtns,
body[class*="branch-8"] div.exportimportbtns,
body[class*="branch-9"] div.exportimportbtns {
	margin-top: -50px;
}


body[class*="branch-7"] input[name="gptranslate_settings_file"],
body[class*="branch-8"] input[name="gptranslate_settings_file"],
body[class*="branch-9"] input[name="gptranslate_settings_file"],
body[class*="branch-7"] input[name="import_file"],
body[class*="branch-8"] input[name="import_file"],
body[class*="branch-9"] input[name="import_file"] {
    border: 1px solid #CCC;
    border-radius: 4px;
    padding-left: 5px;
    padding: 8px;
}

body[class*="branch-7"] .gpt-label:not([class*="bg-"]),
body[class*="branch-8"] .gpt-label:not([class*="bg-"]),
body[class*="branch-9"] .gpt-label:not([class*="bg-"]) {
	background-color: #3858e9;
}

body[class*="branch-7"].wp-core-ui .button-warning.button-crawler,
body[class*="branch-8"].wp-core-ui .button-warning.button-crawler,
body[class*="branch-9"].wp-core-ui .button-warning.button-crawler {
	top: 50px;
}

body[class*="branch-7"] .bg-primary,
body[class*="branch-8"] .bg-primary,
body[class*="branch-9"] .bg-primary,
body[class*="branch-7"] .btn-primary,
body[class*="branch-8"] .btn-primary,
body[class*="branch-9"] .btn-primary {
	background-color: #3858e9;
}

body[class*="branch-7"] #btn_test_apikey span.dashicons,
body[class*="branch-8"] #btn_test_apikey span.dashicons,
body[class*="branch-9"] #btn_test_apikey span.dashicons {
	line-height: normal;
    margin-top: -1px;
}

body[class*="branch-7"] div.notice.notice-success,
body[class*="branch-8"] div.notice.notice-success,
body[class*="branch-9"] div.notice.notice-success {
	border-top: 1px solid #4ab866;
	border-right: 1px solid #4ab866;
	border-bottom: 1px solid #4ab866;
}

body[class*="branch-7"] div.notice.notice-warning,
body[class*="branch-8"] div.notice.notice-warning,
body[class*="branch-9"] div.notice.notice-warning {
	border-top: 1px solid #f0b849;
	border-right: 1px solid #f0b849;
	border-bottom: 1px solid #f0b849;
}

body[class*="branch-7"].wp-core-ui div.left-filter-container .button,
body[class*="branch-8"].wp-core-ui div.left-filter-container .button,
body[class*="branch-9"].wp-core-ui div.left-filter-container .button,
body[class*="branch-7"].wp-core-ui div.right-filter-container .button,
body[class*="branch-8"].wp-core-ui div.right-filter-container .button,
body[class*="branch-9"].wp-core-ui div.right-filter-container .button  {
	background: #f6f7f7;
}

body[class*="branch-7"] .form-table th,
body[class*="branch-8"] .form-table th,
body[class*="branch-9"] .form-table th {
	border-left-color: #3858e9;
}

body[class*="branch-7"] input[name="exactmatch"],
body[class*="branch-8"] input[name="exactmatch"],
body[class*="branch-9"] input[name="exactmatch"]{
	border: 1px solid #3858e9;
}

body[class*="branch-7"] .gpt-apikey-wrap .dashicons,
body[class*="branch-8"] .gpt-apikey-wrap .dashicons,
body[class*="branch-9"] .gpt-apikey-wrap .dashicons {
    margin-top: 5px;
}

/* Rate us button & review modal */
#gpt-rate-btn {
    position: absolute;
    top: 5px;
    right: 0;
    z-index: 9990;
    display: flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
    padding: 5px 10px 5px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    box-shadow: -2px 2px 6px rgba(0, 0, 0, .08);
    transition: background .15s;
    display: none;
}

#gpt-rate-btn:hover {
    background: #fafafa;
}

#gpt-rate-btn .gpt-heart {
    color: #e03e3e;
    font-size: 13px;
}

#gpt-rate-btn .gpt-stars {
    color: #f0b429;
    letter-spacing: 1px;
}

#gpt-review-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 99998;
    align-items: center;
    justify-content: center;
}

#gpt-review-overlay.open {
    display: flex;
}

#gpt-review-box {
    background: #fff;
    border-radius: 8px;
    padding: 30px 32px 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .22);
    position: relative;
    text-align: center;
}

#gpt-review-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
}

#gpt-review-close:hover {
    color: #555;
}

.gpt-review-stars {
    color: #f0b429;
    font-size: 26px;
    letter-spacing: 3px;
    margin: 4px 0 10px;
}

.gpt-review-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
    color: #1d2327;
}

.gpt-review-desc {
    margin: 0 0 20px;
    color: #555;
    font-size: 13px;
    line-height: 1.65;
}

.gpt-review-cta {
    display: inline-block;
    background: #2271b1;
    color: #fff !important;
    padding: 9px 22px;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.gpt-review-cta:hover {
    background: #135e96;
}

.gpt-review-links {
    font-size: 12px;
}

.gpt-review-links a {
    color: #aaa;
    text-decoration: none;
    margin: 0 8px;
}

.gpt-review-links a:hover {
    color: #777;
}

.gpt-review-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
    font-size: 11px;
    color: #bbb;
}

.gpt-review-footer a {
    color: #bbb;
    text-decoration: none;
}

.gpt-review-footer a:hover {
    color: #888;
}
