/**
 * R2 Cloud Storage — Admin Styles
 *
 * @package R2CloudStorage
 */

/* ── Header ───────────────────────────────────────────── */
.r2cs-wrap h1 {
	display: flex;
	align-items: center;
	gap: 8px;
}

.r2cs-header-icon {
	font-size: 28px;
	color: #f38020; /* Cloudflare orange */
}

.r2cs-version {
	font-size: 12px;
	color: #999;
	font-weight: normal;
	background: #f0f0f0;
	padding: 2px 8px;
	border-radius: 10px;
}

/* ── Dashboard Cards ──────────────────────────────────── */
.r2cs-dashboard-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
	margin: 20px 0;
}

.r2cs-card {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 20px;
	display: flex;
	align-items: center;
	gap: 16px;
	transition: box-shadow 0.2s;
}

.r2cs-card:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.r2cs-card-icon {
	font-size: 36px;
	color: #f38020;
	width: 40px;
	height: 40px;
}

.r2cs-card-content {
	display: flex;
	flex-direction: column;
}

.r2cs-card-number {
	font-size: 24px;
	font-weight: 700;
	color: #1d2327;
	line-height: 1.2;
}

.r2cs-card-label {
	font-size: 13px;
	color: #666;
}

/* ── Settings Container ───────────────────────────────── */
.r2cs-settings-container {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 24px;
	margin-top: 16px;
}

.r2cs-settings-container h2 {
	border-bottom: 2px solid #f38020;
	padding-bottom: 10px;
	margin-top: 32px;
}

.r2cs-settings-container h2:first-of-type {
	margin-top: 0;
}

.r2cs-actions-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 16px;
}

.r2cs-actions-row .dashicons {
	vertical-align: middle;
	margin-top: -2px;
	margin-right: 4px;
}

.r2cs-inline-message {
	padding: 4px 12px;
	border-radius: 4px;
	font-size: 13px;
	display: none;
}

.r2cs-inline-message.success {
	display: inline-block;
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.r2cs-inline-message.error {
	display: inline-block;
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.r2cs-inline-message.loading {
	display: inline-block;
	background: #fff3cd;
	color: #856404;
	border: 1px solid #ffeeba;
}

/* ── Sync Page ────────────────────────────────────────── */
.r2cs-sync-container {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 24px;
	margin-top: 16px;
}

.r2cs-progress-container {
	margin: 24px 0;
}

.r2cs-progress-bar-wrapper {
	width: 100%;
	height: 32px;
	background: #f0f0f0;
	border-radius: 16px;
	overflow: hidden;
	position: relative;
}

.r2cs-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #f38020, #ff6633);
	border-radius: 16px;
	transition: width 0.4s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
}

.r2cs-progress-bar span {
	color: #fff;
	font-weight: 700;
	font-size: 13px;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.r2cs-progress-details {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	color: #666;
	font-size: 13px;
}

.r2cs-sync-log {
	margin-top: 24px;
}

.r2cs-log-entries {
	max-height: 300px;
	overflow-y: auto;
	background: #1d2327;
	color: #c3c4c7;
	padding: 16px;
	border-radius: 8px;
	font-family: monospace;
	font-size: 12px;
	line-height: 1.6;
}

.r2cs-log-entry.success {
	color: #46b450;
}

.r2cs-log-entry.error {
	color: #dc3232;
}

.r2cs-sync-actions {
	display: flex;
	gap: 12px;
	margin-top: 24px;
}

.r2cs-sync-actions .dashicons {
	vertical-align: middle;
	margin-top: -2px;
	margin-right: 4px;
}

.button-hero .dashicons {
	font-size: 18px;
}

/* ── Add-ons Grid ─────────────────────────────────────── */
.r2cs-addons-intro {
	color: #666;
	font-size: 14px;
	margin-bottom: 24px;
}

.r2cs-addons-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 20px;
	margin-bottom: 32px;
}

.r2cs-addon-card {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 24px;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s, border-color 0.2s;
}

.r2cs-addon-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.r2cs-addon-status-active {
	border-color: #46b450;
	border-left: 4px solid #46b450;
}

.r2cs-addon-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.r2cs-addon-icon {
	font-size: 28px;
	color: #f38020;
}

.r2cs-addon-header h3 {
	margin: 0;
	font-size: 16px;
	flex: 1;
}

.r2cs-addon-version {
	font-size: 11px;
	background: #f0f0f0;
	padding: 2px 6px;
	border-radius: 8px;
	color: #666;
}

.r2cs-addon-description {
	color: #555;
	font-size: 13px;
	line-height: 1.5;
	flex: 1;
}

/* ── License Section ──────────────────────────────────── */
.r2cs-license-section {
	margin-top: 12px;
	padding: 12px;
	background: #f9f9f9;
	border: 1px solid #e8e8e8;
	border-radius: 6px;
}

.r2cs-license-label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 12px;
	font-weight: 600;
	color: #1d2327;
	margin-bottom: 8px;
}

.r2cs-license-status {
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 10px;
	background: #f0f0f0;
	color: #999;
}

.r2cs-license-status.active {
	background: #dcfce7;
	color: #16a34a;
}

.r2cs-license-row {
	display: flex;
	gap: 8px;
}

.r2cs-license-row .r2cs-license-input {
	flex: 1;
	padding: 6px 10px;
	font-size: 13px;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.r2cs-license-row .button {
	white-space: nowrap;
}

.r2cs-license-message {
	display: none;
	font-size: 12px;
	margin-top: 6px;
}

.r2cs-license-message.success {
	display: block;
	color: #16a34a;
}

.r2cs-license-message.error {
	display: block;
	color: #dc2626;
}

.r2cs-addon-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #f0f0f0;
}

.r2cs-addon-pricing {
	display: flex;
	flex-direction: column;
}

.r2cs-addon-price {
	font-size: 16px;
	font-weight: 700;
	color: #1d2327;
}

/* ── Badges ───────────────────────────────────────────── */
.r2cs-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
}

.r2cs-badge-active {
	background: #d4edda;
	color: #155724;
}

.r2cs-badge-active .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

.r2cs-badge-installed {
	background: #d1ecf1;
	color: #0c5460;
}

.r2cs-badge-warning {
	background: #fff3cd;
	color: #856404;
	font-size: 11px;
}

/* ── Developer CTA ────────────────────────────────────── */
.r2cs-developer-cta {
	background: #f9f9f9;
	border: 1px dashed #ccc;
	border-radius: 8px;
	padding: 24px;
	text-align: center;
}

.r2cs-developer-cta h2 {
	margin-top: 0;
}

.r2cs-developer-cta code {
	display: block;
	text-align: left;
	background: #1d2327;
	color: #c3c4c7;
	padding: 16px;
	border-radius: 8px;
	margin-top: 16px;
	font-size: 13px;
	white-space: pre;
	overflow-x: auto;
}

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

	.r2cs-addons-grid {
		grid-template-columns: 1fr;
	}

	.r2cs-actions-row {
		flex-direction: column;
		align-items: flex-start;
	}
}
