/**
 * Send Secret — CSS
 *
 * Styles for the send-secret modal (engineer-facing) and the
 * public view page (recipient-facing). Fully white-label compliant:
 * all accent colours inherit from CSS custom properties.
 *
 * @package AJT_MSP_Hub
 * @since   1.23.0
 */

/* ══════════════════════════════════════════════════════════
 *  Topbar Button (sits next to the notification bell)
 * ══════════════════════════════════════════════════════════ */

.ajt-cm-sendsecret-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
}

/* ══════════════════════════════════════════════════════════
 *  Modal Overlay
 * ══════════════════════════════════════════════════════════ */

.ajt-secret-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(37, 40, 61, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	animation: ajtSecretFadeIn 0.2s ease;
	font-family: var(--msphub-font-family, 'Nunito Sans', sans-serif);
}

@keyframes ajtSecretFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes ajtSecretSlideUp {
	from { opacity: 0; transform: translateY(20px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ══════════════════════════════════════════════════════════
 *  Modal Container
 * ══════════════════════════════════════════════════════════ */

.ajt-secret-modal {
	width: 100%;
	max-width: 480px;
	max-height: 85vh;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.04);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: ajtSecretSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	font-family: var(--msphub-font-family, 'Nunito Sans', sans-serif);
}

/* ── Header ── */

.ajt-secret-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px 0;
	border-bottom: 1px solid var(--ajt-card-border, #DBD8DE);
}

.ajt-secret-modal-tabs {
	display: flex;
	gap: 0;
}

.ajt-secret-modal-tab {
	background: none;
	border: none;
	padding: 10px 18px 12px;
	font-size: 13px;
	font-weight: 700;
	color: #888;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	transition: color 0.15s, border-color 0.15s;
	font-family: inherit;
}

.ajt-secret-modal-tab:hover {
	color: #555;
}

.ajt-secret-modal-tab.active {
	color: var(--msphub-primary, var(--ajt-plum, #A04398));
	border-bottom-color: var(--msphub-primary, var(--ajt-plum, #A04398));
}

.ajt-secret-modal-close {
	background: none;
	border: none;
	color: var(--ajt-gray-400, #9ca3af);
	cursor: pointer;
	width: 32px;
	height: 32px;
	padding: 0;
	border-radius: 8px;
	transition: background 0.15s, color 0.15s;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.ajt-secret-modal-close:hover {
	background: var(--ajt-gray-100, #f0f0f0);
	color: var(--ajt-gray-700, #374151);
}

/* ── Body ── */

.ajt-secret-modal-body {
	padding: 20px;
	overflow-y: auto;
	flex: 1;
}

/* ── Fields ── */

.ajt-secret-field {
	margin-bottom: 16px;
}

.ajt-secret-field label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 6px;
}

.ajt-secret-optional {
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
	color: #999;
	font-size: 11px;
}

.ajt-secret-input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 13px;
	font-family: inherit;
	color: #333;
	background: #fafafa;
	transition: border-color 0.15s, box-shadow 0.15s;
	box-sizing: border-box;
}

.ajt-secret-input:focus {
	outline: none;
	border-color: var(--msphub-primary, var(--ajt-plum, #A04398));
	box-shadow: 0 0 0 3px var(--msphub-primary-light, rgba(160, 67, 152, 0.1));
	background: #fff;
}

.ajt-secret-textarea {
	resize: vertical;
	min-height: 100px;
	font-family: 'Consolas', monospace;
	font-size: 12px;
	line-height: 1.5;
}

.ajt-secret-charcount {
	display: block;
	text-align: right;
	font-size: 11px;
	color: #aaa;
	margin-top: 4px;
}

/* ── Row (side-by-side fields) ── */

.ajt-secret-row {
	display: flex;
	gap: 12px;
}

.ajt-secret-field--half {
	flex: 1;
}

/* ── Toggle ── */

.ajt-secret-toggle-label {
	display: flex !important;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	text-transform: none !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	letter-spacing: 0 !important;
	color: #444 !important;
}

.ajt-secret-toggle-label input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--msphub-primary, var(--ajt-plum, #A04398));
}

.ajt-secret-pw-field {
	margin-top: 10px;
}

.ajt-secret-hint {
	font-size: 11px;
	color: #999;
	margin-top: 6px;
	line-height: 1.4;
}

select.ajt-secret-input {
	appearance: auto;
	cursor: pointer;
}

/* ── Footer / Submit ── */

.ajt-secret-modal-footer {
	padding-top: 8px;
}

/* ══════════════════════════════════════════════════════════
 *  Buttons (shared)
 * ══════════════════════════════════════════════════════════ */

.ajt-secret-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border: none;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.15s, transform 0.1s, opacity 0.15s;
	line-height: 1;
}

.ajt-secret-btn:active {
	transform: scale(0.97);
}

.ajt-secret-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.ajt-secret-btn--send,
.ajt-secret-btn--reveal,
.ajt-secret-btn--unlock {
	background: var(--msphub-primary, var(--ajt-plum, #A04398));
	color: #fff;
	width: 100%;
	justify-content: center;
}

.ajt-secret-btn--send:hover:not(:disabled),
.ajt-secret-btn--reveal:hover:not(:disabled),
.ajt-secret-btn--unlock:hover:not(:disabled) {
	background: var(--msphub-primary-hover, #8a3a83);
}

.ajt-secret-btn--copy,
.ajt-secret-btn--copy-link {
	background: #f0f0f0;
	color: #555;
	font-size: 12px;
	padding: 8px 14px;
}

.ajt-secret-btn--copy:hover,
.ajt-secret-btn--copy-link:hover {
	background: #e4e4e4;
}

.ajt-secret-btn--another {
	background: none;
	color: var(--msphub-primary, var(--ajt-plum, #A04398));
	font-size: 13px;
	padding: 8px 16px;
	width: 100%;
	justify-content: center;
	margin-top: 8px;
}

.ajt-secret-btn--another:hover {
	background: var(--msphub-primary-light, rgba(160, 67, 152, 0.08));
}

.ajt-secret-btn--destroy {
	background: none;
	color: #DC2626;
	font-size: 11px;
	padding: 4px 10px;
	border: 1px solid #fecaca;
	border-radius: 6px;
}

.ajt-secret-btn--destroy:hover {
	background: #fef2f2;
}

/* ══════════════════════════════════════════════════════════
 *  Success State (in modal, after send)
 * ══════════════════════════════════════════════════════════ */

.ajt-secret-success {
	text-align: center;
	padding: 12px 0;
}

.ajt-secret-success-icon {
	color: #059669;
	margin-bottom: 12px;
}

.ajt-secret-success-msg {
	font-size: 14px;
	font-weight: 700;
	color: #333;
	margin-bottom: 16px;
}

.ajt-secret-link-box {
	display: flex;
	gap: 6px;
	margin-bottom: 12px;
}

.ajt-secret-link-box .ajt-secret-input {
	flex: 1;
	font-size: 11px;
	font-family: 'Consolas', monospace;
	color: #666;
	background: #f7f6f8;
}

.ajt-secret-pw-reminder {
	font-size: 13px;
	color: #A04398;
	background: #faf5f9;
	padding: 10px 14px;
	border-radius: 8px;
	border-left: 3px solid #A04398;
	text-align: left;
	margin-bottom: 8px;
}

/* ══════════════════════════════════════════════════════════
 *  History Tab
 * ══════════════════════════════════════════════════════════ */

.ajt-secret-history-loading {
	text-align: center;
	color: #999;
	padding: 32px 0;
	font-size: 13px;
}

.ajt-secret-history-empty {
	text-align: center;
	color: #999;
	padding: 32px 0;
	font-size: 13px;
}

.ajt-secret-history-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 0;
	border-bottom: 1px solid #f0f0f0;
	gap: 10px;
}

.ajt-secret-history-item:last-child {
	border-bottom: none;
}

.ajt-secret-history-info {
	flex: 1;
	min-width: 0;
}

.ajt-secret-history-recipient {
	font-size: 13px;
	font-weight: 600;
	color: #333;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ajt-secret-history-label {
	font-size: 11px;
	color: #888;
	margin-top: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ajt-secret-history-meta {
	font-size: 11px;
	color: #aaa;
	margin-top: 2px;
}

.ajt-secret-history-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

/* Status badges */
.ajt-secret-badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 3px 8px;
	border-radius: 10px;
	white-space: nowrap;
}

.ajt-secret-badge--pending {
	background: #FEF3C7;
	color: #92400E;
}

.ajt-secret-badge--viewed {
	background: #D1FAE5;
	color: #065F46;
}

.ajt-secret-badge--expired {
	background: #F3F4F6;
	color: #6B7280;
}

.ajt-secret-badge--destroyed {
	background: #FEE2E2;
	color: #991B1B;
}

/* ══════════════════════════════════════════════════════════
 *  Public View Page
 * ══════════════════════════════════════════════════════════ */

.ajt-secret-view {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
	padding: 40px 20px;
	font-family: var(--msphub-font-family, 'Nunito Sans'), sans-serif;
}

.ajt-secret-card {
	width: 100%;
	max-width: 460px;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
	overflow: hidden;
}

.ajt-secret-card-header {
	text-align: center;
	padding: 32px 24px 24px;
	background: linear-gradient(135deg,
		var(--msphub-dark, #25283D) 0%,
		var(--msphub-gradient-end, #3a3d52) 100%
	);
	color: #fff;
	font-family: var(--msphub-font-family, 'Nunito Sans'), -apple-system, BlinkMacSystemFont, sans-serif;
}

.ajt-secret-card-header h2,
.ajt-secret-card-header p {
	font-family: inherit !important;
	-webkit-text-stroke: 0 !important;
	text-stroke: 0 !important;
}

.ajt-secret-lock-icon {
	margin-bottom: 12px;
	opacity: 0.9;
}

.ajt-secret-title {
	font-size: 18px;
	font-weight: 800;
	margin: 0 0 4px;
	font-family: var(--msphub-font-family, 'Nunito Sans'), -apple-system, BlinkMacSystemFont, sans-serif !important;
	color: #fff !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	-webkit-text-stroke: 0 !important;
	text-stroke: 0 !important;
	-webkit-text-fill-color: #fff !important;
	text-shadow: none !important;
	line-height: 1.3;
}

.ajt-secret-subtitle {
	font-size: 12px;
	opacity: 0.7;
	margin: 0;
	font-family: var(--msphub-font-family, 'Nunito Sans'), -apple-system, BlinkMacSystemFont, sans-serif !important;
	color: #fff !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	-webkit-text-stroke: 0 !important;
	-webkit-text-fill-color: rgba(255, 255, 255, 0.7) !important;
	text-shadow: none !important;
}

/* States */
.ajt-secret-state {
	padding: 28px 24px;
}

.ajt-secret-info {
	font-size: 14px;
	color: #444;
	line-height: 1.6;
	margin: 0 0 12px;
	text-align: center;
}

.ajt-secret-warning {
	font-size: 12px;
	color: #999;
	text-align: center;
	margin: 0 0 20px;
}

/* Password form (view page) */
.ajt-secret-pw-form {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
}

.ajt-secret-pw-form .ajt-secret-input {
	flex: 1;
}

.ajt-secret-pw-form .ajt-secret-btn {
	flex-shrink: 0;
}

.ajt-secret-pw-error {
	font-size: 12px;
	color: #DC2626;
	text-align: center;
	margin-top: 8px;
}

/* Content display */
.ajt-secret-content {
	background: #f7f6f8;
	border: 1px solid #e8e6eb;
	border-radius: 8px;
	padding: 16px;
	font-family: 'Consolas', monospace;
	font-size: 13px;
	line-height: 1.6;
	color: #333;
	white-space: pre-wrap;
	word-break: break-word;
	max-height: 300px;
	overflow-y: auto;
	margin-bottom: 16px;
}

.ajt-secret-actions {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 12px;
}

.ajt-secret-destroyed-note,
.ajt-secret-views-note {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: #059669;
	justify-content: center;
	margin-top: 8px;
}

.ajt-secret-views-note {
	color: #D97706;
}

/* Gone state */
.ajt-secret-state--gone {
	text-align: center;
	padding: 40px 24px;
}

.ajt-secret-gone-icon {
	color: #DC2626;
	opacity: 0.6;
	margin-bottom: 16px;
}

.ajt-secret-gone-msg {
	font-size: 14px;
	color: #666;
	line-height: 1.6;
}

/* Footer */
.ajt-secret-footer {
	text-align: center;
	padding: 16px;
}

.ajt-secret-footer p {
	font-size: 11px;
	color: #bbb;
	margin: 0;
}

/* ══════════════════════════════════════════════════════════
 *  Responsive
 * ══════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
	.ajt-secret-modal {
		max-width: 100%;
		max-height: 95vh;
		border-radius: 14px 14px 0 0;
	}

	.ajt-secret-modal-overlay {
		align-items: flex-end;
		padding: 0;
	}

	.ajt-secret-row {
		flex-direction: column;
		gap: 0;
	}

	.ajt-secret-pw-form {
		flex-direction: column;
	}

	.ajt-secret-pw-form .ajt-secret-btn {
		width: 100%;
		justify-content: center;
	}
}
