/**
 * Thrive Dashboard - API Keys tab + tab navigation styles
 */

/* Remove Materialize active/focus backgrounds on this page */
.td-api-tabs-bar button:focus,
.td-api-tabs-bar button:active,
.td-api-keys-area .td-copy-btn:focus,
.td-api-keys-area .td-copy-btn:active,
.td-api-keys-area .td-key-actions button:focus,
.td-api-keys-area .td-key-actions button:active {
	background-color: inherit;
	outline: none;
}

/* ========== Tab Navigation ========== */
.td-api-tabs-bar {
	display: flex;
	gap: 0;
	margin-bottom: 24px;
	border-bottom: 2px solid #ddd;
}

.td-tab-btn {
	padding: 12px 28px;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #999;
	cursor: pointer;
	border: none;
	background: transparent;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	transition: all 0.15s;
	user-select: none;
	position: relative;
}

.td-tab-btn:hover {
	color: #555;
}

.td-tab-btn.active {
	color: #333;
	border-bottom-color: #58b958;
}

.td-tab-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #f0a030;
	color: #fff;
	font-size: 9px;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 10px;
	margin-left: 8px;
	letter-spacing: 0;
	text-transform: uppercase;
	vertical-align: middle;
}

.td-tab-btn.active .td-tab-badge {
	background: #58b958;
}

/* Tab panels */
.td-tab-panel {
	display: none;
}

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

/* ========== API Keys Tab ========== */
.td-api-keys-area {
	padding: 16px 0;
}

.td-api-keys-intro {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 20px;
	gap: 20px;
}

.td-api-keys-intro p {
	font-size: 13px;
	color: #666;
	line-height: 1.6;
	max-width: 600px;
	margin: 0;
}

.td-key-name-error {
	display: block;
	visibility: hidden;
	color: #e04040;
	font-size: 12px;
	min-height: 36px;
	margin-top: 4px;
}

.td-key-name-error.active {
	visibility: visible;
}

.td-btn-create-key {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 18px;
	background: #58b958;
	color: #fff;
	border: none;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s;
}

.td-btn-create-key:hover {
	background: #4aa84a;
}

.td-btn-create-key .td-plus {
	font-size: 16px;
	font-weight: 400;
	line-height: 1;
}

.td-btn-create-key:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.td-btn-cancel {
	display: inline-flex;
	align-items: center;
	padding: 8px 18px;
	background: #555;
	color: #fff;
	border: none;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	cursor: pointer;
	transition: background 0.15s;
}

.td-btn-cancel:hover {
	background: #444;
}

/* ========== Create Key Modal ========== */
.td-create-key-modal {
	display: none;
	position: fixed;
	top: 15%;
	left: 50%;
	transform: translateX(-50%);
	width: 500px;
	max-width: 90%;
	max-height: 80vh;
	z-index: 1003;
	background: #fff;
	overflow-y: auto;
}

#wpbody .td-create-key-modal .tvd-modal-close-x {
	position: absolute;
	top: 10px;
	right: 20px;
	color: #999;
	font-size: 24px;
}

.td-create-key-modal .tvd-modal-content {
	position: relative;
	padding-top: 24px;
}

.td-create-key-modal .tvd-modal-content::after {
	height: 16px;
}

.td-create-key-modal .tvd-modal-title {
	font-size: 16px;
	font-weight: 600;
	color: #333;
	margin: 0 0 20px;
	padding-right: 30px;
}

.td-create-key-modal .tvd-modal-footer {
	display: flex;
	gap: 10px;
	padding: 16px 24px;
	border-top: 1px solid #eee;
}

.td-form-row label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	margin-bottom: 6px;
}

.td-create-key-modal .tvd-input-field {
	margin-top: 0;
}

.td-create-key-modal .tvd-input-field input[type="text"] {
	border: none;
	border-bottom: 1px solid #ddd;
	border-radius: 0;
	outline: none;
	box-shadow: none;
	margin-bottom: .5rem;
}

.td-create-key-modal .tvd-input-field input[type="text"]:focus {
	border-bottom: 2px solid #58b958;
	box-shadow: none;
}

/* ========== Key Items List ========== */
.td-keys-list {
	margin-bottom: 24px;
}

.td-key-item {
	background: #fff;
	border: 1px solid #ddd;
	padding: 16px 20px;
	margin-bottom: -1px;
	display: flex;
	align-items: center;
	gap: 20px;
	transition: background 0.1s;
}

.td-key-item:hover {
	background: #fafafa;
}

.td-key-status-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}

.td-key-status-dot.td-active {
	background: #5cb85c;
}

.td-key-status-dot.td-inactive {
	background: #ccc;
}

.td-key-info {
	flex: 1;
	min-width: 0;
}

.td-key-name {
	font-size: 14px;
	font-weight: 600;
	color: #333;
	margin-bottom: 3px;
}

.td-key-meta {
	font-size: 11px;
	color: #999;
	display: flex;
	gap: 16px;
}

/* Inactive key row - muted appearance */
.td-key-item.td-key-inactive .td-key-name {
	color: #aaa;
}

.td-key-item.td-key-inactive .td-key-meta {
	color: #ccc;
}

.td-key-item.td-key-inactive .td-key-value-display {
	color: #bbb;
}

.td-key-value-display {
	font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
	font-size: 12px;
	color: #888;
	background: #f5f5f5;
	padding: 6px 12px;
	border: 1px solid #e5e5e5;
	letter-spacing: 0.5px;
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.td-copy-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: #58b958;
	font-size: 13px;
	padding: 0;
	display: flex;
	align-items: center;
}

.td-copy-btn:hover {
	color: #4aa84a;
}

.td-key-actions {
	display: flex;
	gap: 4px;
	flex-shrink: 0;
}

.td-key-actions button {
	background: none;
	border: 1px solid #ddd;
	padding: 5px 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	color: #777;
	cursor: pointer;
	transition: all 0.15s;
}

.td-key-actions .td-toggle-btn {
	min-width: 70px;
	text-align: center;
}

.td-key-actions button:hover {
	border-color: #999;
	color: #333;
}

.td-key-actions .td-delete-btn:hover {
	border-color: #d9534f;
	color: #d9534f;
}

/* ========== Empty State ========== */
.td-empty-state {
	text-align: center;
	padding: 60px 20px;
	background: #fff;
	border: 1px solid #ddd;
}

.td-empty-icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 16px;
	background: #f5f5f5;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.td-empty-icon .dashicons {
	font-size: 28px;
	width: 28px;
	height: 28px;
	color: #bbb;
}

.td-empty-state h3 {
	font-size: 15px;
	font-weight: 600;
	color: #333;
	margin-bottom: 6px;
}

.td-empty-state p {
	font-size: 13px;
	color: #999;
	margin-bottom: 20px;
	line-height: 1.5;
}

/* ========== Info Notice ========== */
.td-info-notice {
	background: #f7f7f7;
	border: 1px solid #ddd;
	padding: 12px 16px;
	display: flex;
	gap: 10px;
	align-items: baseline;
	margin-top: 16px;
}

.td-info-i {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #5a9abd;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin-top: 1px;
}

#wpbody .td-info-notice p {
	font-size: 12px;
	font-weight: normal;
	color: #666;
	line-height: 1.5;
	margin: 0;
}

.td-info-notice .td-info-link {
	color: #5a9abd;
	text-decoration: none;
	font-weight: normal;
}

.td-info-notice .td-info-link:hover {
	text-decoration: underline;
}

/* ========== Loading State ========== */
.td-keys-loading {
	text-align: center;
	padding: 40px 20px;
	color: #999;
	font-size: 13px;
}

/* ========== Footer ========== */
.td-keys-footer {
	margin-top: 24px;
}
