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

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
	line-height: 1.6;
	color: #333;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	min-height: 100vh;
	padding: 20px;
}

/* Container */
.container {
	max-width: 800px;
	margin: 0 auto;
	background: white;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	overflow: hidden;
}

/* Header */
header {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	padding: 40px 30px;
	text-align: center;
}

header h1 {
	font-size: 2em;
	margin-bottom: 10px;
}

.subtitle {
	font-size: 1.1em;
	opacity: 0.9;
}

/* Main Content */
main {
	padding: 30px;
}

/* Sections */
.section {
	margin-bottom: 30px;
}

.section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
}

.section h2 {
	color: #667eea;
	margin-bottom: 20px;
	font-size: 1.5em;
}

/* Form Styles */
.form-group {
	margin-bottom: 20px;
}

.form-group label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #555;
}

.hint {
	display: block;
	font-size: 0.85em;
	color: #888;
	font-weight: normal;
	margin-top: 4px;
}

input[type='text'],
input[type='password'],
input[type='file'] {
	width: 100%;
	padding: 12px;
	border: 2px solid #e0e0e0;
	border-radius: 6px;
	font-size: 1em;
	transition: border-color 0.3s;
}

input[type='text']:focus,
input[type='password']:focus,
input[type='file']:focus {
	outline: none;
	border-color: #667eea;
}

.file-info {
	margin-top: 10px;
	padding: 12px;
	background: #f5f5f5;
	border-radius: 6px;
	font-size: 0.9em;
	line-height: 1.8;
}

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

.btn {
	padding: 12px 24px;
	border: none;
	border-radius: 6px;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s;
	text-decoration: none;
	display: inline-block;
	text-align: center;
}

.btn-primary {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
}

.btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
	background: #e0e0e0;
	color: #555;
}

.btn-secondary:hover {
	background: #d0d0d0;
}

.btn-danger {
	background: #f44336;
	color: white;
}

.btn-danger:hover {
	background: #d32f2f;
}

.btn-copy {
	background: #4caf50;
	color: white;
	white-space: nowrap;
}

.btn-copy:hover {
	background: #45a049;
}

.btn-small {
	padding: 6px 12px;
	font-size: 0.85em;
}

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

/* Progress Bar */
.progress-container {
	margin: 30px 0;
}

.progress-bar {
	width: 100%;
	height: 30px;
	background: #e0e0e0;
	border-radius: 15px;
	overflow: hidden;
	margin-bottom: 10px;
}

.progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
	transition: width 0.3s ease;
	border-radius: 15px;
}

.progress-text {
	display: flex;
	justify-content: space-between;
	font-size: 0.9em;
	color: #666;
}

/* Stats */
.stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 15px;
	margin: 20px 0;
	padding: 20px;
	background: #f5f5f5;
	border-radius: 8px;
}

.stat {
	display: flex;
	flex-direction: column;
}

.stat-label {
	font-size: 0.85em;
	color: #888;
	margin-bottom: 4px;
}

.stat-value {
	font-size: 1.5em;
	font-weight: bold;
	color: #667eea;
}

.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 15px;
	margin: 20px 0;
}

.stat-card {
	padding: 20px;
	background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
	border-radius: 8px;
	text-align: center;
}

/* Status Messages */
.status-message {
	text-align: center;
	color: #666;
	font-style: italic;
}

.success-text {
	color: #4caf50;
	text-align: center;
	font-size: 1.1em;
}

.error-message {
	color: #f44336;
	text-align: center;
	font-size: 1.1em;
	margin: 20px 0;
}

.warning {
	color: #ff9800;
	font-size: 0.9em;
	margin: 10px 0;
}

/* Success/Error Sections */
.success-section {
	border: 2px solid #4caf50;
	border-radius: 8px;
	padding: 30px;
	background: #f1f8f4;
}

.error-section {
	border: 2px solid #f44336;
	border-radius: 8px;
	padding: 30px;
	background: #fef5f5;
}

/* Download Link */
.download-link-container {
	margin: 30px 0;
}

.download-link-container label {
	display: block;
	margin-bottom: 10px;
	font-weight: 600;
	color: #555;
}

.input-with-button {
	display: flex;
	gap: 10px;
}

.download-url-input {
	flex: 1;
	font-family: monospace;
	font-size: 0.9em;
}

/* Table Styles */
.files-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 20px;
	background: white;
}

.files-table thead {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
}

.files-table th {
	padding: 15px 10px;
	text-align: left;
	font-weight: 600;
}

.files-table td {
	padding: 15px 10px;
	border-bottom: 1px solid #e0e0e0;
}

.files-table tbody tr:hover {
	background: #f5f5f5;
}

.filename-cell {
	font-weight: 600;
	color: #667eea;
	max-width: 250px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Loading State */
.loading {
	text-align: center;
	padding: 40px;
	color: #888;
}

.loading::after {
	content: '...';
	animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
	0%,
	20% {
		content: '.';
	}
	40% {
		content: '..';
	}
	60%,
	100% {
		content: '...';
	}
}

/* Empty State */
.empty-state {
	text-align: center;
	padding: 60px 20px;
	color: #888;
	font-size: 1.2em;
}

/* Modal */
.modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	align-items: center;
	justify-content: center;
	z-index: 1000;
}

.modal-content {
	background: white;
	padding: 30px;
	border-radius: 12px;
	max-width: 500px;
	width: 90%;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
	margin-bottom: 20px;
	color: #667eea;
}

.modal-buttons {
	display: flex;
	gap: 10px;
	margin-top: 20px;
	justify-content: flex-end;
}

/* Footer */
footer {
	padding: 20px 30px;
	text-align: center;
	background: #f5f5f5;
	border-top: 1px solid #e0e0e0;
	font-size: 0.9em;
}

footer a {
	color: #667eea;
	text-decoration: none;
	font-weight: 600;
}

footer a:hover {
	text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 600px) {
	body {
		padding: 10px;
	}

	header {
		padding: 30px 20px;
	}

	header h1 {
		font-size: 1.5em;
	}

	main {
		padding: 20px;
	}

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

	.btn {
		width: 100%;
	}

	.input-with-button {
		flex-direction: column;
	}

	.download-url-input {
		width: 100%;
	}

	.files-table {
		font-size: 0.85em;
	}

	.files-table th,
	.files-table td {
		padding: 10px 5px;
	}

	/* Hide less important columns on mobile */
	.files-table th:nth-child(3),
	.files-table td:nth-child(3) {
		display: none;
	}

	.stats {
		grid-template-columns: 1fr;
	}

	.section-header {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}
}

/* Scrollbar Styles */
::-webkit-scrollbar {
	width: 10px;
}

::-webkit-scrollbar-track {
	background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
	background: #667eea;
	border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
	background: #5568d3;
}

/* ============================================ */
/* УПЯЧКА СТАЙЛ - БЕЗУМИЕ И ХАОС */
/* ============================================ */

.upyachka-header {
	background: linear-gradient(90deg,
		#ff0000 0%, #ff7f00 14%, #ffff00 28%,
		#00ff00 42%, #0000ff 57%, #4b0082 71%,
		#9400d3 85%, #ff0000 100%);
	background-size: 200% 200%;
	animation: rainbow-bg 3s ease infinite;
	padding: 30px 20px;
	text-align: center;
	border-bottom: 5px solid #000;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	overflow: hidden;
}

.upyachka-line {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 15px;
	margin: 15px 0;
	animation: line-wiggle 2s ease-in-out infinite;
}

.crazy-text {
	display: inline-block;
	font-family: 'Impact', 'Arial Black', sans-serif;
	font-size: 1.8em;
	font-weight: bold;
	text-shadow:
		3px 3px 0 #000,
		-1px -1px 0 #000,
		1px -1px 0 #000,
		-1px 1px 0 #000,
		5px 5px 10px rgba(0, 0, 0, 0.5);
	letter-spacing: 2px;
	margin: 5px;
	transition: transform 0.3s ease;
}

.crazy-text:hover {
	transform: scale(1.2) rotate(5deg);
}

/* Радужный текст */
.crazy-text.rainbow {
	background: linear-gradient(90deg,
		#ff0000, #ff7f00, #ffff00, #00ff00,
		#0000ff, #4b0082, #9400d3);
	background-size: 200% auto;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	animation: rainbow-text 2s linear infinite;
}

/* Мега размер */
.crazy-text.mega {
	animation: mega-pulse 1.5s ease-in-out infinite;
}

/* Анимация мигания */
@keyframes blink {
	0%, 49% { opacity: 1; }
	50%, 100% { opacity: 0; }
}

.crazy-text.blink {
	animation: blink 1s step-start infinite;
}

/* Анимация вращения */
@keyframes spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

.crazy-text.spin {
	animation: spin 2s linear infinite;
}

/* Анимация тряски */
@keyframes shake {
	0%, 100% { transform: translateX(0); }
	10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
	20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.crazy-text.shake {
	animation: shake 0.5s infinite;
}

/* Анимация волны */
@keyframes wave {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-10px); }
}

.crazy-text.wave {
	animation: wave 1s ease-in-out infinite;
}

/* Анимация вращения текста */
@keyframes rotate {
	0% { transform: rotate(-5deg); }
	50% { transform: rotate(5deg); }
	100% { transform: rotate(-5deg); }
}

.crazy-text.rotate {
	animation: rotate 1s ease-in-out infinite;
}

/* Анимация пульсации */
@keyframes pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.1); }
}

.crazy-text.pulse {
	animation: pulse 1s ease-in-out infinite;
}

/* Анимация радужного фона */
@keyframes rainbow-bg {
	0% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
	100% { background-position: 0% 50%; }
}

/* Анимация радужного текста */
@keyframes rainbow-text {
	to { background-position: 200% center; }
}

/* Анимация покачивания строки */
@keyframes line-wiggle {
	0%, 100% { transform: skewX(0deg); }
	25% { transform: skewX(-2deg); }
	75% { transform: skewX(2deg); }
}

/* Мега пульсация */
@keyframes mega-pulse {
	0%, 100% {
		transform: scale(1) rotate(0deg);
		filter: hue-rotate(0deg);
	}
	50% {
		transform: scale(1.15) rotate(2deg);
		filter: hue-rotate(180deg);
	}
}

/* Адаптив для мобилок */
@media (max-width: 768px) {
	.upyachka-header {
		padding: 20px 10px;
	}

	.crazy-text {
		font-size: 1.2em !important;
	}

	.crazy-text.mega {
		font-size: 2em !important;
	}

	.upyachka-line {
		gap: 8px;
		margin: 10px 0;
	}
}
