/**
 * Media Library Optimization Styles
 *
 * Styles for image optimization features in WordPress Media Library
 *
 * @package ProRank\SEO
 * @since   1.0.0
 */

/* ==========================================================================
   Optimization Status Badges
   ========================================================================== */

.prorank-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.4;
}

.prorank-badge .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	line-height: 14px;
}

.prorank-badge-success {
	background-color: rgba(70, 180, 80, 0.1);
	color: #2e7d32;
	border: 1px solid rgba(70, 180, 80, 0.3);
}

.prorank-badge-success .dashicons {
	color: #46b450;
}

.prorank-badge-pending {
	background-color: rgba(150, 150, 150, 0.1);
	color: #666;
	border: 1px solid rgba(150, 150, 150, 0.3);
}

.prorank-badge-queued {
	background-color: rgba(255, 193, 7, 0.1);
	color: #9a6700;
	border: 1px solid rgba(255, 193, 7, 0.3);
}

.prorank-badge-queued .dashicons {
	color: #f0ad4e;
}

.prorank-badge-error {
	background-color: rgba(220, 50, 50, 0.1);
	color: #c62828;
	border: 1px solid rgba(220, 50, 50, 0.3);
}

.prorank-badge-na {
	color: #999;
	padding: 4px;
}

/* ==========================================================================
   Media Library Column
   ========================================================================== */

.column-prorank_optimization {
	width: 120px;
}

.column-prorank_optimization .prorank-optimize-now-btn {
	display: block;
	margin-top: 4px;
	padding: 2px 8px;
	font-size: 11px;
}

/* ==========================================================================
   Attachment Edit Page Metabox
   ========================================================================== */

.prorank-attachment-optimization-metabox {
	padding: 0;
}

.prorank-opt-status {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px;
	margin: -12px -12px 15px -12px;
	font-weight: 600;
	font-size: 13px;
}

.prorank-opt-status .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

.prorank-opt-status-success {
	background: linear-gradient(135deg, rgba(70, 180, 80, 0.15), rgba(70, 180, 80, 0.05));
	color: #2e7d32;
	border-bottom: 1px solid rgba(70, 180, 80, 0.2);
}

.prorank-opt-status-success .dashicons {
	color: #46b450;
}

.prorank-opt-status-pending {
	background: linear-gradient(135deg, rgba(150, 150, 150, 0.15), rgba(150, 150, 150, 0.05));
	color: #666;
	border-bottom: 1px solid rgba(150, 150, 150, 0.2);
}

.prorank-opt-status-pending .dashicons {
	color: #999;
}

/* Details Table */
.prorank-opt-details {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 10px;
}

.prorank-opt-details td {
	padding: 6px 0;
	vertical-align: top;
	border-bottom: 1px solid #f0f0f0;
}

.prorank-opt-details td:first-child {
	color: #666;
	width: 45%;
	font-size: 12px;
}

.prorank-opt-details td:last-child {
	font-weight: 500;
	text-align: right;
}

.prorank-opt-details tr:last-child td {
	border-bottom: none;
}

/* Format Badges */
.prorank-format-badge {
	display: inline-block;
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	margin-right: 4px;
}

.prorank-format-webp {
	background-color: #4caf50;
	color: #fff;
}

.prorank-format-avif {
	background-color: #2196f3;
	color: #fff;
}

/* Action Buttons */
.prorank-opt-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.prorank-opt-actions .button {
	flex: 1;
	min-width: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
}

.prorank-opt-actions .button .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.prorank-opt-options {
	background: #f9f9f9;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	padding: 12px;
}

.prorank-opt-options .button-small {
	margin-right: 4px;
	margin-bottom: 4px;
}

/* Spinner */
.prorank-opt-spinner {
	background: rgba(255, 255, 255, 0.9);
	position: relative;
}

.prorank-opt-spinner .spinner {
	margin: 0 auto 10px;
}

.prorank-opt-spinner-text {
	margin: 0;
	color: #666;
	font-size: 13px;
}

/* ==========================================================================
   Media Modal Optimization Field
   ========================================================================== */

.prorank-attachment-optimization {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.prorank-status-optimized {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #46b450;
	font-weight: 600;
}

.prorank-status-optimized .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.prorank-savings {
	font-size: 12px;
}

.prorank-optimize-modal-btn {
	display: inline-flex !important;
	align-items: center;
	gap: 4px;
}

.prorank-optimize-modal-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	margin-top: 0;
}

.prorank-modal-spinner {
	vertical-align: middle;
}

.prorank-modal-status {
	font-size: 12px;
}

/* ==========================================================================
   Grid View Badges (handled via JS, but base styles here)
   ========================================================================== */

.prorank-grid-optimization-badge {
	position: absolute;
	bottom: 4px;
	right: 4px;
	background: rgba(70, 180, 80, 0.95);
	color: #fff;
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 10px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 3px;
	z-index: 10;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.prorank-grid-optimization-badge .dashicons {
	font-size: 12px;
	width: 12px;
	height: 12px;
}

.prorank-grid-optimization-badge.pending {
	background: rgba(150, 150, 150, 0.95);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media screen and (max-width: 782px) {
	.column-prorank_optimization {
		display: none;
	}

	.prorank-opt-actions {
		flex-direction: column;
	}

	.prorank-opt-actions .button {
		width: 100%;
	}
}

/* ==========================================================================
   Animation
   ========================================================================== */

@keyframes prorank-pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

.prorank-processing {
	animation: prorank-pulse 1.5s ease-in-out infinite;
}

/* Processing state for buttons */
.prorank-optimize-btn.processing,
.prorank-restore-btn.processing,
.prorank-optimize-now-btn.processing,
.prorank-optimize-modal-btn.processing {
	pointer-events: none;
	opacity: 0.7;
}
