/**
 * Admin CSS for Filestack Alt Text Generator
 *
 * Styles for the admin interface, progress bars, and dashboard.
 */

/* Branding */
.filestack-branding {
	margin: 20px 0 10px;
}

.filestack-logo {
	height: 40px;
	width: auto;
}

/* Toggle Visibility Button */
.filestack-toggle-visibility {
	margin-left: 5px;
	vertical-align: middle;
}

/* Dashboard Layout */
.filestack-alt-text-dashboard {
	max-width: 1200px;
	margin: 20px 0;
}

/* Cards */
.filestack-stats-card,
.filestack-processing-card {
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	padding: 20px;
	margin-bottom: 20px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.filestack-stats-card h2,
.filestack-processing-card h2 {
	margin-top: 0;
	font-size: 18px;
	font-weight: 600;
	border-bottom: 1px solid #eee;
	padding-bottom: 10px;
}

/* Statistics */
.filestack-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-top: 15px;
}

.filestack-stat-item {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.filestack-stat-label {
	font-size: 14px;
	color: #666;
}

.filestack-stat-value {
	font-size: 32px;
	font-weight: 600;
	color: #2271b1;
}

/* Processing Controls */
#filestack-processing-controls {
	margin: 20px 0;
}

#filestack-processing-controls .button {
	margin-right: 10px;
}

/* Progress Bar */
#filestack-progress-container {
	background: #f0f0f1;
	padding: 20px;
	border-radius: 4px;
	border: 1px solid #ccd0d4;
}

.filestack-progress-bar {
	width: 100%;
	height: 30px;
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	overflow: hidden;
	position: relative;
}

.filestack-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #2271b1 0%, #135e96 100%);
	transition: width 0.3s ease;
	position: relative;
}

.filestack-progress-fill::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.3),
		transparent
	);
	animation: shimmer 2s infinite;
}

@keyframes shimmer {
	0% {
		transform: translateX(-100%);
	}
	100% {
		transform: translateX(100%);
	}
}

.filestack-progress-text {
	display: flex;
	justify-content: space-between;
	margin-top: 10px;
	font-size: 14px;
	color: #666;
}

#progress-status {
	font-weight: 600;
}

#progress-percentage {
	font-weight: 600;
	color: #2271b1;
}

/* Results */
#filestack-results {
	background: #f0f0f1;
	padding: 20px;
	border-radius: 4px;
	border: 1px solid #ccd0d4;
}

#filestack-results h3 {
	margin-top: 0;
	font-size: 16px;
	font-weight: 600;
}

.filestack-results-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 30px;
	margin-top: 15px;
}

.filestack-result-item {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.filestack-result-label {
	font-size: 14px;
	color: #666;
}

.filestack-result-value {
	font-size: 24px;
	font-weight: 600;
	color: #2271b1;
}

/* Media Library Column */
.column-filestack_alt_text {
	width: 120px;
}

.filestack-has-alt {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
}

.filestack-no-alt {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
}

.filestack-generate-single {
	margin-top: 5px;
}

/* Single Image Generation */
.filestack-generate-result {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
	.filestack-stats {
		flex-direction: column;
	}

	.filestack-results-summary {
		flex-direction: column;
		gap: 15px;
	}

	#filestack-processing-controls .button {
		display: block;
		width: 100%;
		margin-bottom: 10px;
		margin-right: 0;
	}
}

/* Loading Spinner */
.filestack-stat-value .spinner {
	display: inline-block;
	vertical-align: middle;
}

/* Notices */
.filestack-notice {
	margin: 15px 0;
}

/* Logs Container */
#filestack-logs-container {
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	padding: 20px;
}

#filestack-logs-container h3 {
	margin-top: 0;
	font-size: 16px;
	font-weight: 600;
	border-bottom: 1px solid #eee;
	padding-bottom: 10px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.filestack-logs-list {
	max-height: 600px;
	overflow-y: auto;
	margin-top: 15px;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	background: #fafafa;
}

/* Log Entry */
.filestack-log-entry {
	background: #fff;
	border-bottom: 1px solid #e0e0e0;
	margin: 0;
}

.filestack-log-entry:last-child {
	border-bottom: none;
}

.filestack-log-entry.log-success {
	border-left: 4px solid #46b450;
}

.filestack-log-entry.log-error {
	border-left: 4px solid #dc3232;
}

/* Log Header */
.filestack-log-header {
	display: flex;
	align-items: center;
	padding: 12px 15px;
	cursor: pointer;
	gap: 10px;
	font-size: 13px;
	transition: background-color 0.2s;
}

.filestack-log-header:hover {
	background-color: #f9f9f9;
}

.log-icon {
	font-size: 16px;
	font-weight: bold;
	width: 20px;
	flex-shrink: 0;
}

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

.log-error .log-icon {
	color: #dc3232;
}

.log-file {
	font-weight: 600;
	color: #2271b1;
	min-width: 150px;
	flex-shrink: 0;
}

.log-timestamp {
	color: #999;
	font-size: 11px;
	min-width: 80px;
	flex-shrink: 0;
}

.log-message {
	flex: 1;
	color: #555;
}

.log-toggle {
	background: none;
	border: none;
	color: #2271b1;
	cursor: pointer;
	font-size: 10px;
	padding: 4px 8px;
	border-radius: 3px;
	transition: background-color 0.2s;
	flex-shrink: 0;
}

.log-toggle:hover {
	background-color: #e5e5e5;
}

/* Log Details */
.filestack-log-details {
	display: none;
	padding: 15px 15px 15px 40px;
	background-color: #f9f9f9;
	border-top: 1px solid #e0e0e0;
	font-size: 13px;
	line-height: 1.6;
}

.log-detail-section {
	margin-bottom: 15px;
}

.log-detail-section:last-child {
	margin-bottom: 0;
}

.log-detail-section h4 {
	margin: 0 0 10px 0;
	font-size: 14px;
	font-weight: 600;
	color: #333;
}

.log-detail-item {
	margin-bottom: 10px;
}

.log-detail-item:last-child {
	margin-bottom: 0;
}

.log-detail-item strong {
	display: inline-block;
	color: #555;
	font-weight: 600;
	margin-bottom: 3px;
}

.log-code {
	display: block;
	background: #2b2b2b;
	color: #f8f8f2;
	padding: 10px;
	border-radius: 4px;
	font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
	font-size: 12px;
	overflow-x: auto;
	white-space: pre-wrap;
	word-wrap: break-word;
	margin-top: 5px;
}

code.log-code {
	display: inline-block;
	padding: 2px 6px;
	background: #e0e0e0;
	color: #333;
	border-radius: 3px;
}

.success-code {
	color: #46b450;
	font-weight: 600;
}

.error-code {
	color: #dc3232;
	font-weight: 600;
}

.log-error-detail {
	background: #ffebe9;
	border: 1px solid #dc3232;
	padding: 10px;
	border-radius: 4px;
	color: #dc3232;
}

.api-log-section {
	background: #fff;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	padding: 15px;
}

/* Scrollbar styling for logs */
.filestack-logs-list::-webkit-scrollbar {
	width: 10px;
}

.filestack-logs-list::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 4px;
}

.filestack-logs-list::-webkit-scrollbar-thumb {
	background: #888;
	border-radius: 4px;
}

.filestack-logs-list::-webkit-scrollbar-thumb:hover {
	background: #555;
}

/* Responsive adjustments for logs */
@media screen and (max-width: 782px) {
	.filestack-log-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 5px;
	}

	.log-timestamp {
		order: -1;
		font-size: 10px;
	}

	.log-file {
		min-width: auto;
	}

	.filestack-log-details {
		padding: 15px;
	}
}
