/* ============================================================
   AJW — AI Markdown Page Widget — Admin CSS
   ============================================================ */

:root {
	--ajwa-green:  #30D48B;
	--ajwa-blue:   #3783FF;
	--ajwa-grad:   linear-gradient(135deg, #30D48B, #3783FF);
	--ajwa-border: #e0e5f0;
	--ajwa-radius: 12px;
	--ajwa-shadow: 0 2px 16px rgba(55,131,255,.1);
}

.ajwa-wrap { max-width: 1300px; }

/* Header */
.ajwa-header { background: var(--ajwa-grad); border-radius: var(--ajwa-radius); padding: 24px 28px; margin: 20px 0 24px; color: white; }
.ajwa-header-inner { display: flex; align-items: center; gap: 14px; }
.ajwa-header h1 { color: white; font-size: 22px; margin: 0 0 3px; }
.ajwa-tagline { color: rgba(255,255,255,.85); margin: 0; font-size: 13px; }

/* Page layout — main + sidebar */
.ajwa-page-layout { display: flex; gap: 24px; align-items: flex-start; }
.ajwa-main-col { flex: 1; min-width: 0; }
.ajwa-sidebar-col { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 18px; }

/* Grid inside main col */
.ajwa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.ajwa-col { display: flex; flex-direction: column; gap: 18px; }

/* Cards */
.ajwa-card { background: #fff; border: 1px solid var(--ajwa-border); border-radius: var(--ajwa-radius); box-shadow: var(--ajwa-shadow); overflow: hidden; }
.ajwa-card-header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--ajwa-border); background: #fafbff; }
.ajwa-card-header h2 { font-size: 14px; margin: 0; flex: 1; }
.ajwa-card-icon { font-size: 16px; }
.ajwa-card-actions { margin-left: auto; }
.ajwa-card-body { padding: 18px; }
.ajwa-sidebar-card .ajwa-card-body { padding: 16px; }

/* Fields */
.ajwa-field { margin-bottom: 18px; }
.ajwa-field:last-child { margin-bottom: 0; }
.ajwa-field label { display: block; margin-bottom: 6px; }
.ajwa-field .description { margin-top: 4px; color: #666; font-size: 12px; }
.ajwa-toggle-field { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.ajwa-field-info { flex: 1; }

/* Toggle switch */
.ajwa-switch { position: relative; display: inline-block; width: 46px; height: 24px; flex-shrink: 0; }
.ajwa-switch input { opacity: 0; width: 0; height: 0; }
.ajwa-slider { position: absolute; inset: 0; background: #cdd2e0; border-radius: 24px; cursor: pointer; transition: .3s; }
.ajwa-slider:before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .3s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.ajwa-switch input:checked + .ajwa-slider { background: var(--ajwa-green); }
.ajwa-switch input:checked + .ajwa-slider:before { transform: translateX(22px); }
.ajwa-switch-sm { width: 34px; height: 18px; }
.ajwa-switch-sm .ajwa-slider:before { width: 12px; height: 12px; }
.ajwa-switch-sm input:checked + .ajwa-slider:before { transform: translateX(16px); }

/* Position selector */
.ajwa-position-selector { display: flex; gap: 10px; }
.ajwa-position-option { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 18px; border: 2px solid var(--ajwa-border); border-radius: 8px; cursor: pointer; transition: all .2s; font-size: 13px; }
.ajwa-position-option input { display: none; }
.ajwa-position-option:hover { border-color: var(--ajwa-blue); }
.ajwa-position-option.active { border-color: var(--ajwa-blue); background: #f0f5ff; }
.ajwa-position-icon { font-size: 18px; }

/* Post types */
.ajwa-post-types { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ajwa-checkbox-label { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #f8f9fc; border: 1px solid var(--ajwa-border); border-radius: 6px; cursor: pointer; font-weight: 500; transition: background .15s; }
.ajwa-checkbox-label:hover { background: #edf2ff; }
.ajwa-checkbox-label input { width: 15px; height: 15px; accent-color: var(--ajwa-blue); }
.ajwa-checkbox-text { flex: 1; }
.ajwa-badge { font-size: 11px; font-weight: 600; background: #e5eaff; color: var(--ajwa-blue); padding: 2px 6px; border-radius: 20px; font-family: monospace; }

/* Preview */
.ajwa-preview-container { background: linear-gradient(135deg,#f0f4ff,#f0fff8); border-radius: 8px; padding: 20px; min-height: 160px; display: flex; align-items: center; justify-content: center; }
.ajwa-widget-preview { display: flex; }
.ajwa-preview-right { justify-content: flex-end; }
.ajwa-preview-left  { justify-content: flex-start; }
.ajwa-widget-preview .ajwa-nav-bar { list-style: none; margin: 0; padding: 0; border-radius: 11px; background: #fff; box-shadow: -2px 0 20px rgba(24,99,220,.18),2px 2px 18px rgba(45,173,112,.2); overflow: hidden; }
.ajwa-widget-preview .ajwa-nav-item { border-bottom: 1px solid #D1E0F8; }
.ajwa-widget-preview .ajwa-nav-item:last-child { border-bottom: none; }
.ajwa-widget-preview .ajwa-nav-item a { display: flex; align-items: center; justify-content: center; padding: 9px 11px; text-decoration: none; }
.ajwa-widget-preview .ajwa-nav-item a:hover { background: #D1E0F8; }
.ajwa-preview-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.ajwa-preview-icon img { width: 100%; height: 100%; object-fit: contain; }
.ajwa-icon-circle { width: 22px; height: 22px; background: var(--ajwa-grad); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 9px; font-weight: 700; }

/* Actions table */
.ajwa-actions-card { margin-bottom: 18px; }
.ajwa-actions-card .ajwa-card-body { padding: 14px; }
.ajwa-actions-table { border-collapse: collapse; table-layout: fixed; }
.ajwa-actions-table th,.ajwa-actions-table td { vertical-align: middle; padding: 9px 7px; }
.ajwa-actions-table thead th { font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #888; }
.col-drag { width: 32px; text-align: center; }
.col-on   { width: 46px; text-align: center; }
.col-icon { width: 96px; }
.col-label { width: 220px; }
.col-type  { width: 150px; }
.col-link  {}
.col-del   { width: 40px; text-align: center; }
.ajwa-drag-handle { cursor: grab; color: #bbb; font-size: 16px; display: block; text-align: center; }
.ajwa-drag-handle:active { cursor: grabbing; }
.ajwa-action-row.ui-sortable-helper { background: #f0f5ff; box-shadow: 0 4px 20px rgba(55,131,255,.18); }
.ajwa-actions-table .ui-sortable-placeholder { background: #e8f0ff; border: 2px dashed var(--ajwa-blue); }
.ajwa-icon-cell { display: flex; align-items: center; gap: 6px; }
.ajwa-icon-preview { width: 30px; height: 30px; background: #f3f4f8; border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.ajwa-icon-preview img { width: 22px; height: 22px; object-fit: contain; }
.ajwa-icon-placeholder { color: #bbb; font-size: 14px; }
.ajwa-icon-controls { display: flex; flex-direction: column; gap: 2px; }
.ajwa-delete-action { color: #cc2200 !important; border-color: #eebbb0 !important; padding: 3px 7px !important; min-height: auto !important; line-height: 1.6 !important; }
.ajwa-delete-action:hover { background: #fff0ed !important; }

/* Submit bar */
.ajwa-submit-bar { display: flex; align-items: center; gap: 14px; padding: 16px 0; }
.ajwa-save-btn { font-size: 14px !important; padding: 7px 24px !important; height: auto !important; background: var(--ajwa-grad) !important; border: none !important; color: white !important; border-radius: 8px !important; }
.ajwa-save-indicator { color: var(--ajwa-green); font-weight: 600; font-size: 13px; }

/* ---- Shortcode card ---- */
.ajwa-shortcode-box { display: flex; align-items: center; gap: 8px; background: #f3f4f8; border: 1px solid var(--ajwa-border); border-radius: 6px; padding: 8px 12px; margin-top: 8px; }
.ajwa-shortcode-box code { flex: 1; font-size: 13px; color: #3783FF; }
.ajwa-shortcode-examples { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.ajwa-shortcode-example { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; background: #fafbff; border: 1px solid var(--ajwa-border); border-radius: 5px; }
.ajwa-shortcode-example code { font-size: 11px; color: #555; }
.ajwa-shortcode-example .button-link { font-size: 11px; color: var(--ajwa-blue); text-decoration: none; flex-shrink: 0; }

/* ---- Info table ---- */
.ajwa-info-table { width: 100%; font-size: 13px; }
.ajwa-info-table td { padding: 5px 0; }
.ajwa-info-table td:first-child { color: #888; width: 90px; }

/* ---- Buy Me a Coffee card ---- */
.ajwa-coffee-card {
	position: relative;
	overflow: hidden;
	border: none !important;
	background: linear-gradient(145deg, #0f172a, #1e293b) !important;
}
.ajwa-coffee-glow {
	position: absolute;
	top: -40px; left: -40px;
	width: 180px; height: 180px;
	background: radial-gradient(circle, rgba(48,212,139,.35) 0%, transparent 70%);
	pointer-events: none;
}
.ajwa-coffee-body {
	position: relative;
	z-index: 1;
	text-align: center;
	padding: 24px 20px !important;
}
.ajwa-coffee-icon {
	font-size: 40px;
	margin-bottom: 10px;
	display: block;
	filter: drop-shadow(0 0 12px rgba(48,212,139,.6));
	animation: ajwa-bob 2.4s ease-in-out infinite;
}
@keyframes ajwa-bob {
	0%,100% { transform: translateY(0); }
	50%      { transform: translateY(-5px); }
}
.ajwa-coffee-title {
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	margin: 0 0 10px;
}
.ajwa-coffee-text {
	font-size: 12px;
	color: rgba(255,255,255,.7);
	line-height: 1.6;
	margin: 0 0 16px;
}
.ajwa-coffee-stats {
	display: flex;
	justify-content: center;
	gap: 20px;
	margin-bottom: 18px;
}
.ajwa-coffee-stat { text-align: center; }
.ajwa-coffee-stat-num { display: block; font-size: 18px; font-weight: 700; color: #30D48B; }
.ajwa-coffee-stat-label { display: block; font-size: 10px; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .5px; }
.ajwa-coffee-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: linear-gradient(135deg, #FFDD00, #FF9900);
	color: #1a1a1a !important;
	font-weight: 700;
	font-size: 14px;
	padding: 11px 22px;
	border-radius: 50px;
	text-decoration: none !important;
	box-shadow: 0 4px 20px rgba(255,200,0,.4);
	transition: transform .2s, box-shadow .2s;
	margin-bottom: 10px;
}
.ajwa-coffee-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 28px rgba(255,200,0,.55);
	color: #1a1a1a !important;
}
.ajwa-coffee-btn-icon { font-size: 16px; }
.ajwa-coffee-sub {
	font-size: 11px;
	color: rgba(255,255,255,.45);
	margin: 0;
}
.ajwa-action-row td.col-label input {
    width: 227px;
}
.ajwa-action-row td.col-link input.regular-text.ajwa-action-link {
    width: 300px;
}
td.col-del button.button.ajwa-delete-action {
    margin-right: -15px;
}
@media (max-width: 1100px) {
	.ajwa-page-layout { flex-direction: column; }
	.ajwa-sidebar-col { width: 100%; flex-direction: row; flex-wrap: wrap; }
	.ajwa-sidebar-col .ajwa-card { flex: 1; min-width: 240px; }
	.ajwa-grid { grid-template-columns: 1fr; }
}
