/* Reset & Base Styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	/* Instagram Gradient Colors */
	--ig-purple: #833AB4;
	--ig-pink: #C13584;
	--ig-red: #E1306C;
	--ig-orange: #F56040;
	--ig-yellow: #FCAF45;

	/* Light Mode */
	--bg-primary: #f5f5f5;
	--bg-secondary: #ffffff;
	--text-primary: #262626;
	--text-secondary: #8e8e8e;
	--border-color: #dbdbdb;
	--shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
	/* Dark Mode */
	--bg-primary: #000000;
	--bg-secondary: #121212;
	--text-primary: #ffffff;
	--text-secondary: #a8a8a8;
	--border-color: #262626;
	--shadow: rgba(255, 255, 255, 0.05);
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	background: var(--bg-primary);
	color: var(--text-primary);
	min-height: 100vh;
	transition: background 0.3s, color 0.3s;
}

.container {
	max-width: 800px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Theme Toggle */
.theme-toggle {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 1000;
}

#themeToggle {
	background: var(--bg-secondary);
	border: 2px solid var(--border-color);
	width: 48px;
	height: 48px;
	border-radius: 6px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	transition: all 0.3s;
}

#themeToggle:hover {
	border-color: var(--ig-pink);
	transform: scale(1.05);
}

[data-theme="light"] .icon-moon {
	display: none;
}

[data-theme="dark"] .icon-sun {
	display: none;
}

/* Toast Notifications */
.toast-container {
	position: fixed;
	top: 80px;
	right: 20px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.toast {
	background: var(--bg-secondary);
	border: 2px solid var(--border-color);
	border-radius: 6px;
	padding: 16px 20px;
	min-width: 300px;
	box-shadow: 0 4px 12px var(--shadow);
	display: flex;
	align-items: center;
	gap: 12px;
	animation: slideIn 0.3s ease;
}

.toast.success {
	border-left: 4px solid #00C853;
}

.toast.error {
	border-left: 4px solid #D32F2F;
}

.toast.info {
	border-left: 4px solid #2196F3;
}

.toast-icon {
	font-size: 24px;
}

.toast-message {
	flex: 1;
	font-size: 14px;
}

.toast-close {
	background: none;
	border: none;
	font-size: 20px;
	cursor: pointer;
	color: var(--text-secondary);
	padding: 0;
	width: 24px;
	height: 24px;
}

@keyframes slideIn {
	from {
		transform: translateX(400px);
		opacity: 0;
	}

	to {
		transform: translateX(0);
		opacity: 1;
	}
}

@keyframes slideOut {
	from {
		transform: translateX(0);
		opacity: 1;
	}

	to {
		transform: translateX(400px);
		opacity: 0;
	}
}

/* Header */
.header {
	text-align: center;
	padding: 60px 20px 40px;
	background: linear-gradient(135deg, var(--ig-purple) 0%, var(--ig-pink) 50%, var(--ig-red) 100%);
	color: white;
}

.header h1 {
	font-size: 2.5rem;
	margin-bottom: 10px;
	font-weight: 700;
}

.header p {
	font-size: 1.1rem;
	opacity: 0.95;
}

/* Main Content */
.main {
	padding: 0 0 60px;
	margin-top: -20px;
}

.card {
	background: var(--bg-secondary);
	border: 2px solid var(--border-color);
	border-radius: 8px;
	padding: 40px;
	box-shadow: 0 2px 8px var(--shadow);
	margin-bottom: 30px;
}

.card h2 {
	font-size: 1.5rem;
	margin-bottom: 20px;
	color: var(--text-primary);
	font-weight: 600;
}

/* Input Group */
.input-group {
	display: flex;
	gap: 10px;
	margin-bottom: 20px;
}

#urlInput {
	flex: 1;
	padding: 14px 16px;
	font-size: 15px;
	border: 2px solid var(--border-color);
	border-radius: 6px;
	outline: none;
	background: var(--bg-primary);
	color: var(--text-primary);
	transition: border-color 0.2s;
}

#urlInput:focus {
	border-color: var(--ig-pink);
}

#urlInput::placeholder {
	color: var(--text-secondary);
}

/* Progress Bar */
.progress-bar {
	margin-bottom: 20px;
	background: var(--bg-primary);
	border: 2px solid var(--border-color);
	border-radius: 6px;
	height: 40px;
	position: relative;
	overflow: hidden;
}

.progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--ig-purple), var(--ig-pink), var(--ig-red));
	width: 0%;
	transition: width 0.3s ease;
}

.progress-text {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-weight: 600;
	font-size: 14px;
	color: var(--text-primary);
	z-index: 1;
}

/* Buttons */
.button-group {
	display: flex;
	gap: 10px;
	margin-bottom: 20px;
}

button {
	padding: 14px 28px;
	font-size: 15px;
	font-weight: 600;
	border: 2px solid var(--border-color);
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--bg-secondary);
	color: var(--text-primary);
}

.btn-primary {
	flex: 1;
	background: linear-gradient(135deg, var(--ig-purple) 0%, var(--ig-pink) 50%, var(--ig-red) 100%);
	color: white;
	border: none;
}

.btn-primary:hover {
	opacity: 0.9;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(193, 53, 132, 0.4);
}

.btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.btn-secondary {
	background: var(--bg-secondary);
	color: var(--text-primary);
	border: 2px solid var(--border-color);
}

.btn-secondary:hover {
	border-color: var(--ig-pink);
}

.btn-download {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 14px 28px;
	background: #00C853;
	color: white;
	text-decoration: none;
	border-radius: 6px;
	font-weight: 600;
	font-size: 15px;
	border: 2px solid #00C853;
	transition: all 0.2s;
}

.btn-download:hover {
	background: #00A043;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 200, 83, 0.4);
}

/* Loader */
.loader {
	width: 20px;
	height: 20px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-top-color: white;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.hidden {
	display: none !important;
}

/* Video Preview */
.video-preview {
	margin-top: 30px;
	text-align: center;
}

.video-preview h3 {
	color: var(--ig-pink);
	margin-bottom: 20px;
	font-size: 1.5rem;
	font-weight: 600;
}

#videoPlayer {
	width: 100%;
	max-width: 500px;
	border: 2px solid var(--border-color);
	border-radius: 6px;
	margin-bottom: 20px;
	background: #000;
}

.video-actions {
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

/* Share Buttons */
.share-buttons {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 2px solid var(--border-color);
}

.share-buttons p {
	margin-bottom: 10px;
	font-size: 14px;
	color: var(--text-secondary);
}

.btn-share {
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 600;
	border: 2px solid var(--border-color);
	border-radius: 6px;
	cursor: pointer;
	margin: 0 5px;
	transition: all 0.2s;
}

.btn-share.whatsapp {
	background: #25D366;
	color: white;
	border-color: #25D366;
}

.btn-share.whatsapp:hover {
	background: #20BA5A;
	transform: translateY(-2px);
}

.btn-share.twitter {
	background: #1DA1F2;
	color: white;
	border-color: #1DA1F2;
}

.btn-share.twitter:hover {
	background: #1A91DA;
	transform: translateY(-2px);
}

/* Download History */
.history-section {
	background: var(--bg-secondary);
	border: 2px solid var(--border-color);
	border-radius: 8px;
	padding: 30px;
	margin-bottom: 30px;
	box-shadow: 0 2px 8px var(--shadow);
}

.history-section h3 {
	margin-bottom: 20px;
	color: var(--text-primary);
	font-size: 1.3rem;
	font-weight: 600;
}

.history-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

.history-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: var(--bg-primary);
	border: 2px solid var(--border-color);
	border-radius: 6px;
	transition: all 0.2s;
}

.history-item:hover {
	border-color: var(--ig-pink);
}

.history-url {
	flex: 1;
	font-size: 13px;
	color: var(--text-secondary);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	margin-right: 10px;
}

.history-time {
	font-size: 12px;
	color: var(--text-secondary);
	margin-right: 10px;
}

.history-actions {
	display: flex;
	gap: 8px;
}

.btn-history {
	padding: 6px 12px;
	font-size: 12px;
	font-weight: 600;
	border: 2px solid var(--border-color);
	border-radius: 4px;
	cursor: pointer;
	background: var(--bg-secondary);
	color: var(--text-primary);
	transition: all 0.2s;
}

.btn-history:hover {
	border-color: var(--ig-pink);
}

.btn-clear-history {
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 600;
	background: #D32F2F;
	color: white;
	border: 2px solid #D32F2F;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s;
}

.btn-clear-history:hover {
	background: #B71C1C;
	transform: translateY(-2px);
}

/* How to Use */
.how-to {
	background: var(--bg-secondary);
	border: 2px solid var(--border-color);
	border-radius: 8px;
	padding: 30px;
	margin-bottom: 30px;
	box-shadow: 0 2px 8px var(--shadow);
}

.how-to h3 {
	margin-bottom: 15px;
	color: var(--ig-pink);
	font-weight: 600;
}

.how-to ol {
	padding-left: 25px;
}

.how-to li {
	margin: 12px 0;
	line-height: 1.6;
	color: var(--text-primary);
}

/* Features */
.features {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 20px;
	margin-bottom: 30px;
}

.feature {
	background: var(--bg-secondary);
	padding: 25px 20px;
	border: 2px solid var(--border-color);
	border-radius: 6px;
	text-align: center;
	box-shadow: 0 2px 8px var(--shadow);
	transition: all 0.2s;
}

.feature:hover {
	border-color: var(--ig-pink);
	transform: translateY(-4px);
}

.feature .icon {
	font-size: 2.5rem;
	display: block;
	margin-bottom: 10px;
}

.feature h4 {
	margin-bottom: 8px;
	color: var(--ig-pink);
	font-weight: 600;
}

.feature p {
	font-size: 0.9rem;
	color: var(--text-secondary);
}

/* SEO Content Section */
.seo-content {
	background: var(--bg-secondary);
	border: 2px solid var(--border-color);
	border-radius: 8px;
	padding: 40px;
	margin-bottom: 30px;
	box-shadow: 0 2px 8px var(--shadow);
	line-height: 1.8;
}

.seo-content h2 {
	color: var(--ig-pink);
	margin-bottom: 20px;
	font-size: 1.8rem;
	font-weight: 600;
}

.seo-content h3 {
	color: var(--text-primary);
	margin-top: 30px;
	margin-bottom: 15px;
	font-size: 1.4rem;
	font-weight: 600;
}

.seo-content p {
	margin-bottom: 15px;
	color: var(--text-primary);
}

.seo-content ul {
	margin: 15px 0;
	padding-left: 30px;
}

.seo-content li {
	margin: 10px 0;
	color: var(--text-primary);
}

.seo-content strong {
	color: var(--ig-pink);
	font-weight: 600;
}

/* FAQ Section */
.faq {
	margin-top: 20px;
}

.faq h4 {
	color: var(--ig-pink);
	margin-top: 25px;
	margin-bottom: 10px;
	font-size: 1.1rem;
	font-weight: 600;
}

.faq p {
	margin-bottom: 15px;
	padding-left: 15px;
	border-left: 4px solid var(--ig-pink);
	color: var(--text-secondary);
}

/* Footer */
.footer {
	text-align: center;
	background: var(--bg-secondary);
	border-top: 2px solid var(--border-color);
	padding: 30px 20px;
	font-size: 0.9rem;
	color: var(--text-secondary);
}

.footer p {
	margin: 5px 0;
}

footer nav {
	margin-top: 15px;
}

footer nav a {
	color: var(--text-secondary);
	text-decoration: none;
	transition: color 0.2s;
}

footer nav a:hover {
	color: var(--ig-pink);
	text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
	.header h1 {
		font-size: 2rem;
	}

	.card {
		padding: 25px;
	}

	.input-group {
		flex-direction: column;
	}

	.button-group {
		flex-direction: column;
	}

	.features {
		grid-template-columns: repeat(2, 1fr);
	}

	.toast {
		min-width: 280px;
	}

	.toast-container {
		right: 10px;
		left: 10px;
	}

	.theme-toggle {
		top: 10px;
		right: 10px;
	}
}

@media (max-width: 480px) {
	.features {
		grid-template-columns: 1fr;
	}

	.share-buttons .btn-share {
		display: block;
		width: 100%;
		margin: 5px 0;
	}

	.video-actions {
		flex-direction: column;
	}

	.video-actions button,
	.video-actions a {
		width: 100%;
	}
}
