/* ── Premium Variables & Reset ── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
	--wtols-primary: #4f46e5;
	--wtols-primary-dark: #4338ca;
	--wtols-primary-light: #e0e7ff;
	--wtols-bg: #f8fafc;
	--wtols-sidebar-bg: rgba(255, 255, 255, 0.85);
	--wtols-border: rgba(226, 232, 240, 0.9);
	--wtols-text: #0f172a;
	--wtols-text-muted: #64748b;
	--wtols-radius: 16px;
	--wtols-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--wtols-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
	--wtols-shadow-hover: 0 20px 25px -5px rgba(99, 102, 241, 0.1), 0 8px 10px -6px rgba(99, 102, 241, 0.1);
	--wtols-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wtols-wrap {
	margin: 30px 20px 0 0;
	font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Page Header ── */
.wtols-page-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 32px;
	padding: 16px 28px;
	background: rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: var(--wtols-radius);
	box-shadow: var(--wtols-shadow-sm);
}

.wtols-page-header h1 {
	display: flex;
	align-items: center;
	gap: 16px;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: 0;
	color: var(--wtols-text);
}

.wtols-header-logo {
	width: 32px;
	height: 32px;
	border-radius: 6px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wtols-hide-header-icon .wtols-header-logo,
.wtols-hide-header-icon #icon-options-general,
.wtols-hide-header-icon .icon32,
.wtols-hide-header-icon h1:before {
	display: none !important;
}

.wtols-save-top {
	background: linear-gradient(135deg, var(--wtols-primary), var(--wtols-primary-dark)) !important;
	border: none !important;
	color: #fff !important;
	padding: 12px 28px !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	height: auto !important;
	border-radius: 12px !important;
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3) !important;
	transition: var(--wtols-transition) !important;
	text-decoration: none !important;
}

.wtols-save-top:hover {
	transform: translateY(-2px) !important;
	box-shadow: 0 8px 16px rgba(79, 70, 229, 0.4) !important;
}

.wtols-button-danger {
	background: linear-gradient(135deg, #ef4444, #dc2626) !important;
	border: none !important;
	color: #fff !important;
	padding: 10px 20px !important;
	height: auto !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	border-radius: 10px !important;
	box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2) !important;
	transition: var(--wtols-transition) !important;
	text-decoration: none !important;
}

.wtols-button-danger:hover {
	transform: translateY(-2px) !important;
	box-shadow: 0 8px 16px rgba(239, 68, 68, 0.3) !important;
}

/* ── Layout ── */
.wtols-admin-layout {
	display: flex;
	gap: 24px;
	align-items: flex-start;
}

/* ── Sidebar Navigation ── */
.wtols-sidebar-nav {
	width: 280px;
	flex-shrink: 0;
	background: var(--wtols-sidebar-bg);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--wtols-border);
	border-radius: var(--wtols-radius);
	padding: 24px;
	box-shadow: var(--wtols-shadow);
	position: sticky;
	top: 50px;
}

.wtols-tab {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 20px;
	color: var(--wtols-text-muted);
	text-decoration: none;
	border-radius: 12px;
	font-weight: 600;
	font-size: 15px;
	transition: var(--wtols-transition);
	cursor: pointer;
	margin-bottom: 8px;
}

.wtols-tab:hover {
	background: var(--wtols-primary-light);
	color: var(--wtols-primary);
	transform: translateX(4px);
}

.wtols-tab .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wtols-tab:hover .dashicons {
	transform: scale(1.15) rotate(5deg);
}

.wtols-tab--active {
	background: linear-gradient(135deg, var(--wtols-primary), var(--wtols-primary-dark)) !important;
	color: #fff !important;
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.wtols-tab--active .dashicons {
	color: #fff;
}

/* ── Sidebar Shortcodes ── */
.wtols-sidebar-shortcodes {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--wtols-border);
}

.wtols-sidebar-shortcodes h3 {
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--wtols-text-muted);
	margin: 0 0 12px 16px;
}

.wtols-sidebar-shortcodes p {
	font-size: 12px;
	color: #a7aaad;
	margin: -8px 0 16px 16px;
}

.wtols-shortcode-list {
	margin: 0;
	padding: 0 8px;
	list-style: none;
}

.wtols-shortcode-list li {
	margin-bottom: 8px;
}

.wtols-shortcode-list code {
	display: block;
	padding: 8px 12px;
	background: #f6f7f7;
	border: 1px solid var(--wtols-border);
	border-radius: 4px;
	font-size: 12px;
	color: var(--wtols-primary);
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wtols-shortcode-list code:hover {
	background: #fff;
	border-color: var(--wtols-primary);
	box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* ── Content Area ── */
.wtols-content-area {
	flex-grow: 1;
	background: #ffffff;
	border: 1px solid var(--wtols-border);
	border-radius: var(--wtols-radius);
	padding: 40px;
	box-shadow: var(--wtols-shadow);
	min-height: 600px;
}

/* ── Tab Panels ── */
.wtols-tab-panel {
	display: none;
	animation: wtolsFadeIn 0.3s ease-out;
}

.wtols-tab-panel--active {
	display: block;
}

@keyframes wtolsFadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ── Form Styling ── */
.wtols-tab-panel h2 {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 24px 0;
	padding-bottom: 16px;
	border-bottom: 2px solid #f6f7f7;
	color: var(--wtols-text);
}

.form-table th {
	width: 200px;
	padding: 20px 10px 20px 0;
	font-weight: 600;
	color: var(--wtols-text);
}

.form-table td {
	padding: 15px 0;
}

.wtols-tab-panel .form-table td[colspan="2"] {
	padding: 15px 20px !important;
}

.form-table input[type="text"],
.form-table input[type="email"],
.form-table textarea,
.form-table select {
	width: 100%;
	max-width: 500px;
	padding: 12px 16px;
	border-radius: 10px;
	border: 1px solid #cbd5e1;
	background: #f8fafc;
	font-family: inherit;
	color: var(--wtols-text);
	transition: var(--wtols-transition);
	box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
	font-size: 14px;
}

.form-table input:focus,
.form-table textarea:focus,
.form-table select:focus {
	border-color: var(--wtols-primary);
	box-shadow: 0 0 0 4px var(--wtols-primary-light);
	background: #ffffff;
	outline: none;
}

/* ── Section Headings & Accordion ── */
.wtols-section-row th {
	padding: 15px 0 5px 0 !important;
}

.wtols-section-row h2 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--wtols-text);
	background-color: #f6f7f7;
	border: 1px solid var(--wtols-border);
	border-radius: 6px;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	user-select: none;
	transition: all 0.2s ease;
}

.wtols-section-row h2:hover {
	background-color: #f0f0f1;
	border-color: #c3c4c7;
}

.wtols-section-row:not(.wtols-section-closed) h2 {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	background-color: #f6f7f7;
	border-bottom-color: #f6f7f7;
	color: var(--wtols-primary);
}

.wtols-accordion-toggle {
	transition: transform 0.3s ease;
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.wtols-section-closed .wtols-accordion-toggle {
	transform: rotate(-90deg);
}

/* ── Tab Panel Styling ── */
.wtols-tab-panel {
	background: #fff;
	padding: 10px 30px 30px 30px;
	border-radius: var(--wtols-radius);
	border: 1px solid var(--wtols-border);
	box-shadow: var(--wtols-shadow);
	animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
	from { opacity: 0; transform: translateY(5px); }
	to { opacity: 1; transform: translateY(0); }
}

.form-table th {
	width: 240px;
	padding: 20px 0;
	border-bottom: 1px solid #f9f9f9;
}

.form-table td {
	padding: 15px 0;
	border-bottom: 1px solid #f9f9f9;
}

.form-table tr:not(.wtols-section-row):hover th,
.form-table tr:not(.wtols-section-row):hover td {
	background: #fafafa;
}

.form-table tr:not(.wtols-section-row) th,
.form-table tr:not(.wtols-section-row) td {
	transition: background 0.2s ease;
}

/* ── Custom Copy Badge ── */
.wtols-copied-badge {
	position: fixed;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	background: #2e7d32;
	color: #fff;
	padding: 12px 24px;
	border-radius: 50px;
	font-weight: 600;
	box-shadow: 0 10px 25px rgba(0,0,0,0.2);
	z-index: 9999;
	display: flex;
	align-items: center;
	gap: 8px;
}

/* ── Business Hours Grid ── */
.wtols-hours-grid {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 600px;
	background: #f9f9f9;
	padding: 20px;
	border-radius: 8px;
	border: 1px solid var(--wtols-border);
}

.wtols-hours-day-row {
	display: grid;
	grid-template-columns: 30px 100px 1fr auto 1fr;
	align-items: center;
	gap: 12px;
}

.wtols-sidebar-footer {
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid var(--wtols-border);
	font-size: 11px;
	color: var(--wtols-text-muted);
	text-align: center;
}

/* ── Social Rows ── */
.wtols-social-admin {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.wtols-social-row {
	display: grid;
	grid-template-columns: 120px 1fr 180px;
	gap: 12px;
	align-items: center;
}

.wtols-custom-social-row {
	grid-template-columns: 140px 1fr 160px 40px !important;
}

.wtols-remove-custom-social {
	color: #d63638 !important;
	border-color: #d63638 !important;
	padding: 0 !important;
	width: 32px;
	height: 32px;
	line-height: 30px !important;
	min-width: auto !important;
}

/* ── Plugin Management ── */
.wtols-plugin-management-scroll {
	border-radius: var(--wtols-radius);
	border: 1px solid var(--wtols-border);
	background: #fff;
}

.wtols-plugin-management-scroll table {
	border: none;
	width: 100%;
}

.wtols-plugin-management-scroll table th,
.wtols-plugin-management-scroll table td {
	padding-left: 20px !important;
}

.wtols-plugin-management-scroll thead th {
	position: sticky;
	top: 0;
	background: #f6f7f7;
	z-index: 10;
	box-shadow: 0 1px 0 var(--wtols-border);
}

/* ── Utilities ── */
.wtols-utility-actions {
	display: flex;
	gap: 12px;
	margin-top: 12px;
}

/* ── Security Logs ── */
.wtols-tab-panel .wp-list-table {
	border: 1px solid var(--wtols-border);
	border-radius: 6px;
	overflow: hidden;
	box-shadow: none;
}

.wtols-tab-panel .wp-list-table thead th {
	background: #f8f9fa;
	font-weight: 600;
}

/* ── Code Center & Editors ── */
.wtols-code-section {
	margin: 24px 0;
	padding: 0 4px;
}

.wtols-code-section h3 {
	margin-bottom: 12px;
	font-size: 16px;
	color: var(--wtols-text);
}

.wtols-editor-wrapper {
	position: relative;
	display: flex;
	background: #f9f9f9;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	overflow: hidden;
	height: 400px; /* Fixed height for the code editor box */
}

.wtols-line-numbers {
	width: 40px;
	padding: 15px 0 !important;
	background: #f0f0f0;
	border-right: 1px solid #dcdcde;
	text-align: center;
	color: #999;
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace !important;
	font-size: 13px !important;
	line-height: 1.6 !important;
	user-select: none;
	overflow: hidden;
	box-sizing: border-box;
	height: 100%; /* Fit container height */
}

.wtols-line-numbers span {
	display: block;
	height: 20.8px; /* 13px * 1.6 = 20.8px */
	line-height: 20.8px;
}

.wtols-code-textarea {
	flex: 1;
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
	padding: 15px !important;
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace !important;
	font-size: 13px !important;
	line-height: 1.6 !important;
	color: #1d2327 !important;
	height: 100% !important; /* Fit container height */
	resize: none !important; /* Disable manual resizing to maintain absolute scroll sync */
	tab-size: 4;
	overflow-y: auto !important; /* Enable scrollbar inside the editor */
	box-sizing: border-box;
}

.wtols-code-textarea:focus {
	outline: none !important;
}

.wtols-editor-wrapper:focus-within {
	border-color: var(--wtols-primary);
	box-shadow: 0 0 0 1px var(--wtols-primary);
}

.wtols-safe-mode-notice {
	background: #fff8e1;
	border-left: 4px solid #ffc107;
	padding: 12px 16px;
	margin-bottom: 15px;
	border-radius: 0 4px 4px 0;
}

.wtols-safe-mode-notice h4 {
	margin: 0 0 5px 0;
	color: #856404;
	display: flex;
	align-items: center;
	gap: 8px;
}

.wtols-safe-mode-notice p {
	margin: 0 0 10px 0;
	font-size: 13px;
	color: #666;
}

.wtols-safe-mode-notice code {
	background: #fff;
	padding: 4px 8px;
	border: 1px solid #ffeeba;
	color: #856404;
	word-break: break-all;
}

.wtols-tab-panel textarea.code {
	font-family: 'SFMono-Regular', Consolas, monospace !important;
	background: #f9f9f9 !important;
	padding: 15px !important;
	border-radius: 6px !important;
}

/* ── Menu Organizer & Modern Toggles ── */
.wtols-tab-panel input[type="checkbox"]:not(.wtols-tick-checkbox) {
	appearance: none;
	-webkit-appearance: none;
	background-color: #cbd5e1;
	margin: 0 16px 0 0;
	width: 48px;
	height: 26px;
	border-radius: 26px;
	position: relative;
	cursor: pointer;
	outline: none;
	border: none;
	transition: var(--wtols-transition);
	vertical-align: middle;
	box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.wtols-tab-panel input[type="checkbox"]:not(.wtols-tick-checkbox):checked {
	background-color: var(--wtols-primary);
}

.wtols-tab-panel input[type="checkbox"]:not(.wtols-tick-checkbox)::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	background-color: white;
	border-radius: 50%;
	transition: var(--wtols-transition);
	box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.wtols-tab-panel input[type="checkbox"]:not(.wtols-tick-checkbox):checked::after {
	transform: translateX(22px);
}

.wtols-tab-panel label {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
	.wtols-admin-layout {
		flex-direction: column;
	}
	.wtols-sidebar-nav {
		width: 100%;
		position: static;
	}
	.wtols-tab {
		display: inline-flex;
		margin-right: 8px;
	}
}

/* Sticky Header */
.wtols-page-header {
    position: sticky;
    top: 32px;
    z-index: 999;
    background: #f0f0f1;
    padding: 12px 0;
    border-bottom: 2px solid #c3c4c7;
    margin-bottom: 20px;
}
.wtols-page-header.is-fixed {
    position: fixed;
    top: 32px;
    left: 160px;
    right: 0;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    z-index: 9980;
    background: #f0f0f1;
    border-bottom: 2px solid #c3c4c7;
}

/* For collapsed sidebar */
.folded .wtols-page-header.is-fixed {
    left: 36px;
}

.wtols-page-header-spacer {
    display: none;
    height: 64px;
}
.wtols-page-header.is-fixed ~ .wtols-page-header-spacer {
    display: block;
}
@media screen and (max-width: 782px) {
    .wtols-page-header,
    .wtols-page-header.is-fixed {
        top: 46px;
    }
    .wtols-page-header.is-fixed {
        left: 0;
        padding-left: 10px;
    }
}

/* ── Hide Default WordPress Checkmark Overlay on Toggles ── */
.wtols-tab-panel input[type="checkbox"]:not(.wtols-tick-checkbox)::before {
	content: none !important;
}

/* ── Redirects Manager Layout ── */
.wtols-redirects-layout {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	margin-top: 20px;
}

@media (max-width: 960px) {
	.wtols-redirects-layout {
		flex-direction: column;
		align-items: stretch;
	}
	.wtols-redirects-form-col,
	.wtols-redirects-list-col {
		min-width: 100% !important;
	}
}

/* ── Pagination Styling ── */
.tablenav-pages {
	display: inline-flex;
	gap: 6px;
	align-items: center;
}
.tablenav-pages .page-numbers {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 4px;
	border: 1px solid var(--wtols-border);
	background: #fff;
	color: var(--wtols-text-muted);
	text-decoration: none;
	font-weight: 500;
	transition: all 0.2s ease;
}
.tablenav-pages .page-numbers:hover {
	border-color: var(--wtols-primary);
	color: var(--wtols-primary);
	background: #f6f7f7;
}
.tablenav-pages .page-numbers.current {
	background: var(--wtols-primary);
	color: #fff;
	border-color: var(--wtols-primary);
}

/* ── Trash Icon Delete Button Styling ── */
.wtols-delete-rule-btn {
	color: #d93025 !important;
	text-decoration: none !important;
	display: inline-block !important;
	padding: 6px !important;
	border: none !important;
	outline: none !important;
	background: none !important;
	box-shadow: none !important;
	border-radius: 4px !important;
	transition: all 0.2s ease !important;
}

.wtols-delete-rule-btn:hover {
	color: #b71c1c !important;
	background: #fbe9e7 !important;
	transform: scale(1.1);
}

.wtols-delete-rule-btn:focus,
.wtols-delete-rule-btn:active {
	outline: none !important;
	box-shadow: none !important;
	border: none !important;
}

/* ── Settings Page Image Previews & Spacing Fixes ── */
.wtols-logo-preview-image {
	max-width: 120px;
	max-height: 120px;
	width: auto;
	height: auto;
	display: block;
	margin-bottom: 10px;
	border: 1px solid var(--wtols-border);
	border-radius: 8px;
	padding: 4px;
	background: #fff;
	object-fit: contain;
}

.wtols-logo-preview {
	margin-bottom: 12px;
	font-size: 13px;
	color: var(--wtols-text-muted);
}

/* Fix table cell padding resetting by form-table td */
.wtols-tab-panel .wp-list-table th,
.wtols-tab-panel .wp-list-table td {
	padding: 12px 15px !important;
}

/* ── Dashboard Notes & Tasks Widget ── */
.wtols-dashboard-widget-wrap {
	font-family: inherit;
}

.wtols-widget-tabs a {
	transition: all 0.2s ease;
	outline: none;
	box-shadow: none;
}

.wtols-widget-tabs a:hover {
	color: #2271b1 !important;
}

#wtols-widget-notes-area {
	box-sizing: border-box;
	line-height: 1.5;
	font-size: 13px;
	background: #fbfbfb;
	color: #1d2327;
	transition: all 0.2s ease;
}

#wtols-widget-notes-area:focus {
	background: #fff;
	border-color: #2271b1;
	outline: none;
	box-shadow: 0 0 0 1px #2271b1;
}

#wtols-widget-task-list::-webkit-scrollbar {
	width: 6px;
}

#wtols-widget-task-list::-webkit-scrollbar-track {
	background: #f1f1f1;
}

#wtols-widget-task-list::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 3px;
}

#wtols-widget-task-list::-webkit-scrollbar-thumb:hover {
	background: #888;
}

.wtols-widget-task-item {
	transition: background 0.15s ease;
}

.wtols-widget-task-item:hover {
	background: #fafafa;
}

.wtols-delete-task-btn {
	opacity: 0.5;
	transition: all 0.2s ease;
	font-weight: bold;
	display: inline-block;
	padding: 2px 6px;
	border-radius: 4px;
}

.wtols-delete-task-btn:hover {
	opacity: 1;
	background: #fbe9e7;
	color: #d63638 !important;
}

