/**
 * SlideShare Downloader Engine - Frontend Styles (Phase 2D Refined)
 */

.ssde-container {
	max-width: 1140px;
	margin: 1rem auto;
	padding: 0 1.5rem;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1e293b;
	box-sizing: border-box;
}

.ssde-container * {
	box-sizing: border-box;
}

/* Hero Section */
.ssde-hero {
	text-align: center;
	padding: 0.5rem 1rem 1.25rem;
}

.ssde-badge {
	display: none;
}

.ssde-title {
	font-size: 2.4rem;
	font-weight: 800;
	color: #0f172a;
	margin: 0 0 0.5rem;
	letter-spacing: -0.025em;
	line-height: 1.2;
}

.ssde-subtitle {
	font-size: 1.08rem;
	color: #475569;
	max-width: 680px;
	margin: 0 auto;
	line-height: 1.6;
}

/* Input Section */
.ssde-input-section {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 1.5rem;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
	margin-bottom: 2rem;
}

.ssde-form {
	width: 100%;
}

.ssde-form-row {
	display: flex;
	gap: 0.75rem;
	align-items: stretch;
}

.ssde-input-wrapper {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
}

.ssde-input-icon {
	position: absolute;
	left: 1.15rem;
	color: #94a3b8;
	pointer-events: none;
	display: flex;
	align-items: center;
}

.ssde-url-input {
	width: 100%;
	height: 52px;
	padding: 0 5.5rem 0 3.25rem;
	font-size: 1rem;
	border: 2px solid #e2e8f0;
	border-radius: 10px;
	outline: none;
	transition: all 0.2s ease;
	background: #ffffff;
	color: #0f172a;
	line-height: 52px;
}

.ssde-url-input:focus {
	border-color: #2563eb;
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ssde-paste-btn {
	position: absolute;
	right: 0.65rem;
	top: 50%;
	transform: translateY(-50%);
	height: 36px;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	background: #f1f5f9;
	color: #334155;
	border: 1px solid #e2e8f0;
	border-radius: 7px;
	padding: 0 0.85rem;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}

.ssde-paste-btn:hover {
	background: #e2e8f0;
	color: #0f172a;
}

.ssde-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	border-radius: 10px;
	border: none;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
}

.ssde-btn-primary {
	background: #2563eb;
	color: #ffffff;
	box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.ssde-btn-primary:hover {
	background: #1d4ed8;
	box-shadow: 0 6px 14px -2px rgba(37, 99, 235, 0.3);
}

.ssde-btn-analyze {
	height: 52px;
	padding: 0 1.75rem;
	font-size: 1rem;
	font-weight: 700;
	white-space: nowrap;
	min-width: 210px;
}

.ssde-btn-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #ffffff;
	animation: ssde-spin 0.8s linear infinite;
}

/* Subtle Collapsible Test Section */
.ssde-test-details {
	margin-top: 1rem;
	border-top: 1px solid #f1f5f9;
	padding-top: 0.75rem;
}

.ssde-test-summary {
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 0.84rem;
	color: #64748b;
	font-weight: 500;
	list-style: none;
	user-select: none;
	padding: 0.25rem 0;
	transition: color 0.15s ease;
}

.ssde-test-summary::-webkit-details-marker {
	display: none;
}

.ssde-test-summary:hover {
	color: #2563eb;
}

.ssde-test-summary-text {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.ssde-test-summary-arrow {
	transition: transform 0.2s ease;
}

.ssde-test-details[open] .ssde-test-summary-arrow {
	transform: rotate(180deg);
}

.ssde-test-pills {
	margin-top: 0.75rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	padding: 0;
	border: none;
}

.ssde-pill {
	background: #f8fafc;
	color: #475569;
	border: 1px solid #e2e8f0;
	border-radius: 20px;
	padding: 0.35rem 0.85rem;
	font-size: 0.8rem;
	cursor: pointer;
	transition: all 0.15s ease;
}

.ssde-pill:hover {
	background: #eff6ff;
	color: #2563eb;
	border-color: #93c5fd;
}

/* Alerts */
.ssde-alert {
	margin-top: 1.25rem;
	padding: 1rem 1.25rem;
	border-radius: 10px;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 0.95rem;
	line-height: 1.5;
}

.ssde-alert-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
}

/* Loading Card */
.ssde-loading-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 3rem 2rem;
	text-align: center;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
	margin-bottom: 2rem;
}

.ssde-spinner-large {
	width: 48px;
	height: 48px;
	margin: 0 auto 1.5rem;
	border: 4px solid #e2e8f0;
	border-radius: 50%;
	border-top-color: #2563eb;
	animation: ssde-spin 0.8s linear infinite;
}

.ssde-loading-card h3 {
	margin: 0 0 0.5rem;
	font-size: 1.35rem;
	color: #0f172a;
}

.ssde-loading-card p {
	margin: 0 0 1.5rem;
	color: #64748b;
}

.ssde-progress-bar-wrap {
	max-width: 450px;
	height: 10px;
	background: #e2e8f0;
	border-radius: 9999px;
	margin: 0 auto 0.75rem;
	overflow: hidden;
}

.ssde-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #3b82f6, #10b981);
	border-radius: 9999px;
	transition: width 0.3s ease;
}

.ssde-progress-status {
	font-size: 0.85rem;
	color: #475569;
	font-weight: 500;
}

/* Results & Meta Card */
.ssde-meta-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 2rem;
	display: flex;
	gap: 2rem;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
	margin-bottom: 2.5rem;
}

.ssde-meta-thumbnail-wrap {
	flex-shrink: 0;
	width: 240px;
}

.ssde-meta-thumb {
	width: 100%;
	border-radius: 10px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
	display: block;
	object-fit: cover;
	aspect-ratio: 4 / 3;
}

.ssde-meta-info {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.ssde-meta-title {
	font-size: 1.6rem;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 0.75rem;
	line-height: 1.3;
}

.ssde-meta-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.ssde-tag {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.3rem 0.75rem;
	border-radius: 6px;
	font-size: 0.8rem;
	font-weight: 600;
}

.ssde-tag-count {
	background: #eff6ff;
	color: #1d4ed8;
}

.ssde-tag-author {
	background: #f1f5f9;
	color: #334155;
}

.ssde-tag-aspect {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	color: #64748b;
}

.ssde-tag-free {
	background: #ecfdf5;
	color: #047857;
}

.ssde-meta-desc {
	font-size: 0.95rem;
	color: #475569;
	line-height: 1.6;
	margin: 0 0 1.5rem;
	max-height: 4.8em;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

/* Quality Selector */
.ssde-quality-selector {
	margin-bottom: 1.5rem;
	padding: 0.85rem 1rem;
	background: #f8fafc;
	border-radius: 10px;
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.ssde-quality-label {
	font-size: 0.9rem;
	font-weight: 600;
	color: #334155;
}

.ssde-quality-options {
	display: flex;
	gap: 1.25rem;
}

.ssde-radio-label {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.9rem;
	color: #1e293b;
	cursor: pointer;
}

.ssde-radio-label input {
	cursor: pointer;
}

/* Action Buttons */
.ssde-action-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.85rem;
	margin-bottom: 0.75rem;
}

.ssde-btn-export {
	padding: 0.85rem 1.4rem;
	font-size: 0.95rem;
	color: #ffffff;
}

.ssde-btn-featured {
	transform: scale(1.03);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4), 0 8px 16px -2px rgba(0, 0, 0, 0.15) !important;
	position: relative;
	z-index: 2;
}

.ssde-btn-pdf {
	background: #dc2626;
	box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.2);
}

.ssde-btn-pdf:hover {
	background: #b91c1c;
}

.ssde-btn-pptx {
	background: #d97706;
	box-shadow: 0 4px 6px -1px rgba(217, 119, 6, 0.2);
}

.ssde-btn-pptx:hover {
	background: #b45309;
}

.ssde-btn-zip {
	background: #059669;
	box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.2);
}

.ssde-btn-zip:hover {
	background: #047857;
}

.ssde-pptx-note {
	font-size: 0.8rem;
	color: #94a3b8;
	font-style: italic;
}

/* Preview Gallery */
.ssde-preview-section {
	margin-top: 2rem;
}

.ssde-preview-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 1.25rem;
	border-bottom: 2px solid #e2e8f0;
	padding-bottom: 0.75rem;
}

.ssde-preview-heading {
	font-size: 1.4rem;
	font-weight: 700;
	color: #0f172a;
	margin: 0;
}

.ssde-preview-hint {
	font-size: 0.85rem;
	color: #64748b;
}

.ssde-slides-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1.25rem;
}

.ssde-slide-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	overflow: hidden;
	transition: all 0.2s ease;
	display: flex;
	flex-direction: column;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.ssde-slide-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
	border-color: #cbd5e1;
}

.ssde-slide-image-wrap {
	position: relative;
	width: 100%;
	background: #f1f5f9;
	overflow: hidden;
	aspect-ratio: 4 / 3;
}

.ssde-slide-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	transition: opacity 0.3s ease;
}

.ssde-slide-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	background: rgba(15, 23, 42, 0.8);
	color: #ffffff;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.2rem 0.55rem;
	border-radius: 4px;
	backdrop-filter: blur(4px);
}

.ssde-slide-actions {
	padding: 0.75rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-top: 1px solid #f1f5f9;
}

.ssde-slide-number {
	font-size: 0.85rem;
	font-weight: 600;
	color: #475569;
}

.ssde-slide-download-btn {
	background: #f8fafc;
	color: #2563eb;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	padding: 0.3rem 0.65rem;
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.ssde-slide-download-btn:hover {
	background: #2563eb;
	color: #ffffff;
	border-color: #2563eb;
}

/* Keyframes */
@keyframes ssde-spin {
	to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
	.ssde-container {
		padding: 0 1rem;
		margin: 0.5rem auto;
	}

	.ssde-hero {
		padding: 1.25rem 0.5rem 1rem;
	}

	.ssde-title {
		font-size: 1.85rem;
	}

	.ssde-subtitle {
		font-size: 1rem;
	}

	.ssde-input-section {
		padding: 1.25rem;
	}

	.ssde-form-row {
		flex-direction: column;
	}

	.ssde-btn-analyze {
		width: 100%;
		min-width: unset;
	}

	.ssde-meta-card {
		flex-direction: column;
		gap: 1.25rem;
		padding: 1.25rem;
	}

	.ssde-meta-thumbnail-wrap {
		width: 100%;
		max-width: 320px;
		margin: 0 auto;
	}

	.ssde-action-buttons {
		flex-direction: column;
	}

	.ssde-btn-export {
		width: 100%;
	}

	.ssde-slides-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 0.75rem;
	}
}
