/**
 * SpamJam Settings Styles
 *
 * @package SpamJam
 */

/* Save indicator */
.spamjam-save-indicator {
	display: inline-block;
	margin-left: 10px;
	font-size: 12px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 3px;
	transition: all 0.3s ease;
}

.spamjam-save-indicator.saving {
	color: #2271b1;
	background: #f0f6fc;
}

.spamjam-save-indicator.saved {
	color: #00a32a;
	background: #f0f6fc;
}

.spamjam-save-indicator.saved::before {
	content: '✓ ';
}

.spamjam-save-indicator.error {
	color: #d63638;
	background: #fcf0f1;
}

/* Notification animations */
.spamjam-notice {
	transition: opacity 0.3s ease;
	margin-top: 15px;
}

/* Disabled field styling */
input[disabled],
textarea[disabled],
select[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Plan badge */
.spamjam-plan-badge {
	display: inline-block;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	border-radius: 3px;
	margin-left: 8px;
}

.spamjam-plan-badge.pro {
	background: #2271b1;
	color: #fff;
}

.spamjam-plan-badge.business {
	background: #00a32a;
	color: #fff;
}

.spamjam-plan-badge.agency {
	background: #8c44b3;
	color: #fff;
}

/* Settings sections */
.form-table h2.title {
	margin-top: 30px;
	margin-bottom: 15px;
	padding-bottom: 10px;
	border-bottom: 1px solid #dcdcde;
}

.form-table h2.title:first-child {
	margin-top: 0;
}

/* Toggle switch improvements */
.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.3s;
}

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

input:checked + .slider {
	background-color: #2271b1;
}

input:focus + .slider {
	box-shadow: 0 0 1px #2271b1;
}

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

input:disabled + .slider {
	opacity: 0.5;
	cursor: not-allowed;
}

.slider.round {
	border-radius: 24px;
}

.slider.round:before {
	border-radius: 50%;
}

/* Description text */
.form-table p.description {
	margin-top: 5px;
	color: #646970;
	font-size: 13px;
}

/* Textarea styling */
.form-table textarea.large-text {
	width: 100%;
	max-width: 600px;
	font-family: 'Courier New', Courier, monospace;
	font-size: 13px;
}

/* Number inputs */
.form-table input[type="number"] {
	width: 100px;
}

/* Info notice */
.notice.inline {
	margin: 0 0 20px 0;
	padding: 12px;
}

/* Upgrade CTA */
.spamjam-upgrade-cta {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	padding: 20px;
	border-radius: 8px;
	margin: 20px 0;
}

.spamjam-upgrade-cta h3 {
	color: #fff;
	margin-top: 0;
}

.spamjam-upgrade-cta .button {
	background: #fff;
	color: #667eea;
	border: none;
	font-weight: 600;
	padding: 8px 20px;
	margin-top: 10px;
}

.spamjam-upgrade-cta .button:hover {
	background: #f0f0f0;
}

/* Loading state */
@keyframes pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

.spamjam-save-indicator.saving {
	animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive */
@media screen and (max-width: 782px) {
	.form-table textarea.large-text {
		max-width: 100%;
	}

	.spamjam-save-indicator {
		display: block;
		margin-left: 0;
		margin-top: 5px;
	}
}

/* ==========================================================================
   Tabbed Interface Styles
   ========================================================================== */

/* Main Wrapper */
.spamjam-settings-wrap h1 {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
}

.spamjam-logo {
	font-size: 32px;
	line-height: 1;
}

/* Tab Navigation */
.nav-tab {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s ease;
}

.nav-tab .tab-icon {
	font-size: 16px;
	line-height: 1;
}

.nav-tab:hover {
	background-color: #f6f7f7;
}

.nav-tab-active {
	font-weight: 600;
}

/* ==========================================================================
   Dashboard Styles
   ========================================================================== */
.spamjam-dashboard {
	padding: 20px 0;
}

.dashboard-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 20px;
	margin-bottom: 20px;
}

.dashboard-card {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 8px;
	padding: 20px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dashboard-card h3 {
	margin-top: 0;
	margin-bottom: 15px;
	font-size: 16px;
	font-weight: 600;
}

/* Stats Grid */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 15px;
}

.stat-item {
	text-align: center;
	padding: 15px;
	background: #f6f7f7;
	border-radius: 6px;
}

.stat-value {
	font-size: 32px;
	font-weight: 700;
	color: #2271b1;
	line-height: 1.2;
}

.stat-label {
	font-size: 13px;
	color: #646970;
	margin-top: 5px;
}

/* Feature List */
.feature-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.feature-list li {
	padding: 10px 0;
	border-bottom: 1px solid #f0f0f1;
	font-size: 14px;
}

.feature-list li:last-child {
	border-bottom: none;
}

.no-features {
	color: #646970;
	font-style: italic;
	margin-bottom: 15px;
}

/* Plan Info */
.plan-info {
	text-align: center;
}

.plan-badge {
	display: inline-block;
	padding: 8px 20px;
	border-radius: 20px;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 15px;
}

.plan-badge.free {
	background: #e0e0e0;
	color: #666;
}

.plan-badge.pro {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
}

.plan-badge.business {
	background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
	color: #fff;
}

.plan-badge.agency {
	background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
	color: #fff;
}

/* Action Buttons */
.action-buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.action-button {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: #f6f7f7;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	text-decoration: none;
	color: #2c3338;
	transition: all 0.2s ease;
}

.action-button:hover {
	background: #fff;
	border-color: #2271b1;
	color: #2271b1;
	transform: translateX(4px);
}

.action-icon {
	font-size: 24px;
	line-height: 1;
}

.action-label {
	font-weight: 500;
	font-size: 14px;
}

/* ==========================================================================
   Tab Content
   ========================================================================== */
.spamjam-tab-content {
	background: #fff;
	padding: 20px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	margin-bottom: 20px;
}

/* Settings Sections */
.settings-section {
	margin-bottom: 30px;
	padding-bottom: 30px;
	border-bottom: 1px solid #f0f0f1;
}

.settings-section:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.section-header {
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.section-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 8px;
}

.section-description {
	color: #646970;
	font-size: 14px;
	margin: 5px 0 0 0;
	flex-basis: 100%;
}

/* Info Boxes */
.settings-info-box {
	background: #f0f6fc;
	border-left: 4px solid #2271b1;
	padding: 15px 20px;
	margin-top: 20px;
	border-radius: 4px;
}

.settings-info-box h4 {
	margin-top: 0;
	margin-bottom: 10px;
	color: #2271b1;
	font-size: 15px;
}

.settings-info-box ul {
	margin: 0;
	padding-left: 20px;
}

.settings-info-box li {
	margin-bottom: 8px;
	font-size: 14px;
	color: #2c3338;
}

/* Dependent Fields */
.dependent-field {
	display: none;
}

.dependent-field.visible {
	display: table-row;
}

/* Spam Log Table */
.reason-badge {
	display: inline-block;
	padding: 4px 10px;
	background: #fcf0f1;
	color: #d63638;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
}

/* ==========================================================================
   Collapsible Sections
   ========================================================================== */
.section-header-collapsible {
	cursor: pointer;
	user-select: none;
}

.section-header-collapsible:hover {
	opacity: 0.8;
}

.section-toggle {
	margin-left: 8px;
	font-size: 12px;
	color: #646970;
	transition: transform 0.2s ease;
}

.section-header-collapsible.collapsed .section-toggle {
	transform: rotate(-90deg);
}

.section-body {
	transition: max-height 0.3s ease, opacity 0.2s ease;
	overflow: hidden;
}

.section-body.collapsed {
	max-height: 0;
	opacity: 0;
	overflow: hidden;
}

/* ==========================================================================
   Upgrade Nudge Cards
   ========================================================================== */
.spamjam-upgrade-nudge {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
	background: #f9f9f9;
	border: 1px dashed #c3c4c7;
	border-radius: 6px;
}

.spamjam-upgrade-nudge .nudge-icon {
	font-size: 28px;
	line-height: 1;
	flex-shrink: 0;
}

.spamjam-upgrade-nudge .nudge-content {
	flex: 1;
}

.spamjam-upgrade-nudge .nudge-content strong {
	font-size: 14px;
}

.spamjam-upgrade-nudge .nudge-content p {
	margin: 4px 0 0;
	color: #646970;
	font-size: 13px;
}

.spamjam-upgrade-nudge .plan-badge {
	font-size: 10px;
	padding: 2px 8px;
	margin-left: 6px;
	vertical-align: middle;
}

/* ==========================================================================
   Feature List (Dashboard)
   ========================================================================== */
.feature-list li.feature-active::before {
	content: '\2713 ';
	color: #00a32a;
	font-weight: 700;
	margin-right: 6px;
}

.features-hint {
	margin-top: 12px;
	font-size: 13px;
	color: #646970;
}

.features-hint a {
	font-weight: 600;
}

/* ==========================================================================
   Comparison Table (Upgrade Tab)
   ========================================================================== */
.spamjam-comparison-table thead th {
	background: #f6f7f7;
	font-weight: 600;
	font-size: 13px;
	padding: 12px 10px;
}

.spamjam-comparison-table tbody td {
	padding: 10px;
	font-size: 13px;
}

.spamjam-comparison-table tbody tr:nth-child(odd) {
	background: #f9f9f9;
}

/* Log table wrapper inside settings */
.log-table-wrapper {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #f0f0f1;
}

.log-table-wrapper h4 {
	margin-top: 0;
	margin-bottom: 12px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media screen and (max-width: 782px) {
	.dashboard-grid {
		grid-template-columns: 1fr;
	}

	.stats-grid {
		grid-template-columns: 1fr;
	}

	.spamjam-upgrade-nudge {
		flex-direction: column;
		text-align: center;
	}

	.spamjam-comparison-table thead th:not(:first-child),
	.spamjam-comparison-table tbody td:not(:first-child) {
		font-size: 11px;
		padding: 8px 4px;
	}
}
