/* ===== ФАЙЛОВЫЙ АРХИВ - ИНКАПСУЛИРОВАННЫЕ СТИЛИ ===== */

/* Заголовок файлового архива */
.file_list .file_list_title {
	margin: 0 0 20px 0;
	font-size: 28px;
	font-weight: 600;
	color: #2c3e50;
}

/* Кнопка управления файлами */
.file_list .btn_manage_files {
	padding: 0 24px;
	background: #007bff;
	color: white;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 500;
	font-size: 15px;
	transition: all 0.2s ease;
	white-space: nowrap;
	height: 48px;
	flex-shrink: 0;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
}

.file_list .btn_manage_files:hover {
	background: #0056b3;
}

.file_list .btn_manage_files:active {
	background: #004085;
}

/* Элементы списка файлов */
.file_list .element{
	display: flex; 
	align-items: center;
	padding: 12px 16px;
	margin-bottom: 8px;
	background: #f8f9fa;
	border-radius: 8px;
	border: 1px solid #e9ecef;
	transition: all 0.2s ease;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.file_list .element:hover {
	box-shadow: 0 3px 8px rgba(0,0,0,0.1);
	border-color: #007bff;
}

.file_list .element .icon_pdf{
	width: 22px;
	height: 22px;
	margin-right: 12px;
	flex-shrink: 0;
}

.file_list .element a {
	flex: 1;
	color: #007bff;
	text-decoration: none;
	font-size: 15px;
	font-weight: 500;
	transition: color 0.2s ease;
	word-break: break-word;
}

.file_list .element a:hover {
	color: #0056b3;
}

.file_list .redirect a{
	color: #28a745 !important;
	font-weight: 600;
}

.file_list .redirect a:hover {
	color: #218838 !important;
}

.file_list .native_link a{
	color: #007bff;
}

/* Кнопка копирования ссылки */
.file_list .copy_link_btn {
	margin-left: 10px;
	padding: 6px;
	background: transparent;
	border: 1px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	color: #6c757d;
	transition: all 0.2s ease;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.file_list .copy_link_btn:hover {
	background: #f8f9fa;
	border-color: #007bff;
	color: #007bff;
}

.file_list .copy_link_btn:active {
	transform: scale(0.95);
}

.file_list .copy_link_btn.copied {
	background: #28a745;
	border-color: #28a745;
	color: white;
}

/* Уведомление о копировании */
.file_list .copy_notification {
	position: fixed;
	top: 20px;
	right: 20px;
	background: #28a745;
	color: white;
	padding: 12px 20px;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	z-index: 10000;
	animation: slideInRight 0.3s ease, slideOutRight 0.3s ease 2s;
	pointer-events: none;
}

@keyframes slideInRight {
	from {
		transform: translateX(400px);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

@keyframes slideOutRight {
	from {
		transform: translateX(0);
		opacity: 1;
	}
	to {
		transform: translateX(400px);
		opacity: 0;
	}
}

.file_list .accordion-button:focus {
	outline: none;
	box-shadow: none;
}

/* Бордеры для accordion-item */
.file_list .accordion-item {
	border-top: 1px solid #dee2e6;
}

.file_list .accordion-item:first-child {
	border-top: 1px solid #dee2e6;
}

/* Отступы внутри аккордеона */
.file_list .accordion-body {
	padding: 20px 15px !important;
}

/* Иконка редактирования файла */
.file_list .file_item_edit {
	width: 16px;
	height: 16px;
	margin-left: 12px;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.2s ease, transform 0.2s ease;
	flex-shrink: 0;
}

.file_list .file_item_edit:hover {
	opacity: 1;
	transform: scale(1.1);
}

/* Стрелка для обычных пользователей */
.file_list .file_item_arrow {
	margin-left: 12px;
	color: #6c757d;
	font-size: 12px;
	flex-shrink: 0;
}

.file_list .element:hover .file_item_edit {
	opacity: 1;
}

/* ===== МОДАЛЬНОЕ ОКНО УПРАВЛЕНИЯ ФАЙЛАМИ ===== */

/* Кнопки переключения вкладок */
.file_list .tab_btn {
	transition: background 0.2s;
}

.file_list .tab_btn.active {
	background: #007bff !important;
}

.file_list .tab_btn:not(.active) {
	background: #6c757d;
}

.file_list .tab_btn:hover {
	opacity: 0.9;
}

/* Карточки файлов в интерфейсе управления */
.file_list .files_cards {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.file_list .file_card {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 8px;
	padding: 15px;
	transition: all 0.2s;
}

.file_list .file_card:hover {
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	border-color: #007bff;
}

.file_list .file_card_header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}

.file_list .file_card_title {
	font-weight: 600;
	color: #212529;
	font-size: 16px;
}

.file_list .file_card_category {
	background: #007bff;
	color: white;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 500;
}

.file_list .file_card_filename {
	color: #6c757d;
	font-size: 14px;
	margin-bottom: 10px;
	font-family: monospace;
}

.file_list .file_card_custom_url {
	margin-bottom: 10px;
}

.file_list .file_card_actions {
	display: flex;
	gap: 10px;
}

.file_list .btn_edit_file,
.file_list .btn_delete_file {
	flex: 1;
	padding: 8px 15px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 500;
	transition: all 0.2s;
}

.file_list .btn_edit_file {
	background: #007bff;
	color: white;
}

.file_list .btn_edit_file:hover {
	background: #0056b3;
}

.file_list .btn_delete_file {
	background: #dc3545;
	color: white;
}

.file_list .btn_delete_file:hover {
	background: #bd2130;
}

/* Drag & Drop зона */
.file_list #drop_zone.drag-over {
	border-color: #0056b3;
	background: #e7f3ff;
}

/* Кнопки в интерфейсе загрузки */
.file_list #select_file_btn:hover,
.file_list #upload_btn:hover {
	background: #0056b3;
}

.file_list #new_category_btn:hover {
	background: #218838;
}

.file_list #cancel_upload_btn:hover,
.file_list #cancel_new_category:hover {
	background: #5a6268;
}

.file_list #remove_file_btn:hover {
	color: #bd2130;
}

/* Кнопки в форме редактирования */
.file_list #save_edit_btn:hover {
	background: #0056b3;
}

.file_list #delete_from_edit_btn:hover {
	background: #c82333;
}

/* ===== ПОИСК ПО ФАЙЛАМ ===== */
.file_list .file_search_container {
	margin: 20px 0;
}

.file_list .file_search_row {
	display: flex;
	align-items: center;
	gap: 15px;
	flex-wrap: wrap;
}

.file_list .file_search_input_wrapper {
	position: relative;
	flex: 1;
	min-width: 300px;
}

.file_list .file_search_input {
	display: flex;
	width: 100%;
	height: 48px;
	padding: 0 50px 0 40px;
	border: 2px solid #ddd;
	border-radius: 8px;
	font-size: 15px;
	transition: all 0.3s;
	margin: 0;
	box-sizing: border-box;
	align-items: center;
}

.file_list .file_search_input:focus {
	outline: none;
	border-color: #007bff;
	box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.file_list .search_icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	width: 20px;
	height: 20px;
	stroke: #999;
	stroke-width: 2;
	fill: none;
}

.file_list .clear_search_btn {
	display: none;
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	color: #6c757d;
	border: none;
	border-radius: 50%;
	width: 28px;
	height: 28px;
	cursor: pointer;
	padding: 0;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
}

.file_list .clear_search_btn svg {
	width: 16px;
	height: 16px;
}

.file_list .clear_search_btn:hover {
	background: rgba(108, 117, 125, 0.1);
	color: #495057;
}

.file_list .clear_search_btn:active {
	transform: translateY(-50%) scale(0.95);
}

.file_list .search_results_count {
	display: none;
	margin-top: 10px;
	color: #28a745;
	font-weight: 500;
}

/* ===== ФИЛЬТРЫ ПО ТЕГАМ ===== */
.file_list .tags_filter_container {
	margin: 20px 0;
	padding: 15px;
	background: #f8f9fa;
	border-radius: 8px;
}

.file_list .tags_filter_container > strong {
	color: #495057;
	display: block;
	margin-bottom: 10px;
}

.file_list .tags_filter_container > div {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.file_list #tags_container {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	flex: 1;
}

.file_list .tag_filter_btn {
	padding: 6px 12px;
	background: white;
	border: 2px solid #dee2e6;
	border-radius: 20px;
	cursor: pointer;
	font-size: 14px;
	transition: all 0.2s;
	white-space: nowrap;
}

.file_list .tag_filter_btn:hover {
	border-color: #007bff;
	background: #e7f3ff;
}

.file_list .tag_filter_btn.active {
	background: #007bff;
	color: white;
	border-color: #007bff;
}

.file_list #clear_filters_btn {
	display: none;
	padding: 6px 12px;
	background: #dc3545;
	color: white;
	border: none;
	border-radius: 20px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
}

.file_list #clear_filters_btn:hover {
	background: #c82333;
}

.file_list #active_filters {
	display: none;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #dee2e6;
}

.file_list #active_filters > span {
	color: #6c757d;
	font-size: 13px;
}

.file_list #active_tags_list {
	display: inline-flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-left: 8px;
}

.file_list .active_tag_item {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 8px;
	background: #007bff;
	color: white;
	border-radius: 12px;
	font-size: 12px;
}

.file_list .remove_tag_btn {
	cursor: pointer;
	font-weight: bold;
	font-size: 14px;
	line-height: 1;
	padding: 0 2px;
	transition: opacity 0.2s;
}

.file_list .remove_tag_btn:hover {
	opacity: 0.7;
}

/* ===== ОТОБРАЖЕНИЕ ФАЙЛОВ В КАРТОЧКАХ ===== */
.file_list .file_content_wrapper {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.file_list .file_title_row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.file_list .file_tags {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
}

.file_list .file_tag {
	font-size: 11px;
	padding: 2px 6px;
	background: #e7f3ff;
	color: #007bff;
	border-radius: 10px;
}

.file_list .file_name_hint {
	display: none;
	color: #6c757d;
	font-size: 11px;
	margin-top: 2px;
}

/* ===== МОДАЛЬНЫЕ ОКНА ЗАГРУЗКИ И РЕДАКТИРОВАНИЯ ===== */
/* Стили для модальных окон file_router (работают независимо от .file_list) */

/* Контейнер модального окна */
.files_manager {
	position: relative;
	padding: 40px;
}

/* Кнопка закрытия модального окна */
.modal_close_btn {
	position: absolute;
	top: 15px;
	right: 15px;
	font-size: 30px;
	line-height: 1;
	color: #999;
	text-decoration: none;
	cursor: pointer;
	z-index: 1000;
	transition: color 0.2s;
}

.modal_close_btn:hover {
	color: #333;
}

/* Заголовок модального окна */
.files_manager h2 {
	margin-bottom: 30px;
	font-size: 24px;
	font-weight: 600;
	color: #212529;
}

/* Drag & Drop зона */
.drop_zone {
	border: 2px dashed #007bff;
	border-radius: 8px;
	padding: 40px;
	text-align: center;
	background: #f8f9fa;
	cursor: pointer;
	margin-bottom: 20px;
	transition: all 0.3s;
}

.drop_zone:hover {
	background: #e7f3ff;
	border-color: #0056b3;
}

.drop_zone_icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 15px;
	stroke: #007bff;
	stroke-width: 2;
	fill: none;
}

.drop_zone_title {
	margin: 0;
	font-size: 16px;
	color: #495057;
	font-weight: 600;
}

.drop_zone_subtitle {
	margin: 10px 0 0 0;
	font-size: 14px;
	color: #6c757d;
}

.select_file_btn {
	margin-top: 15px;
	padding: 10px 20px;
	background: #007bff;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 500;
	transition: background 0.2s;
}

.select_file_btn:hover {
	background: #0056b3;
}

/* Информация о выбранном файле */
.selected_file_info {
	display: none;
	background: #e7f3ff;
	border: 1px solid #007bff;
	border-radius: 4px;
	padding: 15px;
	margin-bottom: 20px;
}

.selected_file_row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.selected_file_content {
	display: flex;
	align-items: center;
	gap: 10px;
}

.files_manager .file_icon {
	width: 24px;
	height: 24px;
	stroke: #007bff;
	stroke-width: 2;
	fill: none;
	flex-shrink: 0;
}

.files_manager .file_details {
	display: flex;
	flex-direction: column;
}

.file_name_display {
	font-weight: 600;
	color: #212529;
}

.file_size_display {
	font-size: 13px;
	color: #6c757d;
}

.remove_file_btn {
	background: transparent;
	border: none;
	color: #dc3545;
	cursor: pointer;
	font-size: 20px;
	padding: 5px 10px;
	transition: opacity 0.2s;
}

.remove_file_btn:hover {
	opacity: 0.7;
}

/* Форма загрузки/редактирования */
.upload_form {
	display: none;
}

.form_group {
	margin-bottom: 20px;
}

.form_label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
	color: #212529;
}

.form_label_optional {
	font-weight: 400;
	color: #6c757d;
	font-size: 13px;
}

.form_input,
.form_select {
	width: 100%;
	padding: 10px;
	border: 1px solid #ced4da;
	border-radius: 4px;
	font-size: 14px;
	transition: border-color 0.2s, box-shadow 0.2s;
}

/* Автоматическая подстройка высоты textarea под содержимое */
.form_input[type="textarea"],
.form_input:is(textarea) {
	min-height: 60px;
	resize: vertical;
	field-sizing: content;
	overflow-y: hidden;
}

.form_input:focus,
.form_select:focus {
	outline: none;
	border-color: #007bff;
	box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Стили для плейсхолдеров */
.form_input::placeholder,
.form_input::-webkit-input-placeholder {
	color: #ced4da;
	opacity: 0.5;
}

.form_input::-moz-placeholder {
	color: #ced4da;
	opacity: 0.5;
}

.form_input:-ms-input-placeholder {
	color: #ced4da;
	opacity: 0.5;
}

.form_input:-moz-placeholder {
	color: #ced4da;
	opacity: 0.5;
}

.form_hint {
	color: #6c757d;
	font-size: 12px;
	display: block;
	margin-top: 5px;
}

.form_row {
	display: flex;
	gap: 10px;
}

.form_row .form_input,
.form_row .form_select {
	flex: 1;
}

.btn_secondary {
	padding: 10px 20px;
	background: #28a745;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	white-space: nowrap;
	font-weight: 500;
	transition: background 0.2s;
}

.btn_secondary:hover {
	background: #218838;
}

.btn_cancel {
	padding: 10px 20px;
	background: #6c757d;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 500;
	transition: background 0.2s;
}

.btn_cancel:hover {
	background: #5a6268;
}

.new_category_field {
	display: none;
	margin-bottom: 15px;
}

/* Кнопки действий в форме */
.form_actions {
	display: flex;
	gap: 10px;
	margin-top: 30px;
}

.btn_primary {
	flex: 1;
	padding: 12px 24px;
	background: #007bff;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 500;
	font-size: 15px;
	transition: background 0.2s;
}

.btn_primary:hover {
	background: #0056b3;
}

.btn_primary:disabled {
	background: #6c757d;
	cursor: not-allowed;
}

.btn_danger {
	padding: 12px 24px;
	background: #dc3545;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 500;
	font-size: 15px;
	transition: background 0.2s;
}

.btn_danger:hover {
	background: #c82333;
}

.btn_danger:disabled {
	background: #6c757d;
	cursor: not-allowed;
}

/* ===== ПЕРЕИМЕНОВАНИЕ ФАЙЛА ===== */

/* Строка с полем ввода имени + бейдж расширения */
.rename_row {
	display: flex;
	align-items: stretch;
	gap: 0;
}

.rename_row .form_input {
	flex: 1;
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
	border-right: none;
}

.file_ext_badge {
	display: flex;
	align-items: center;
	padding: 0 14px;
	background: #e9ecef;
	border: 1px solid #ced4da;
	border-left: none;
	border-radius: 0 4px 4px 0;
	font-size: 14px;
	font-family: monospace;
	color: #495057;
	white-space: nowrap;
	user-select: none;
	box-sizing: border-box;
	height: 42px;
}

/* Состояние ошибки для поля ввода */
.form_input.input_error {
	border-color: #dc3545;
	box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.form_input.input_error:focus {
	border-color: #dc3545;
	box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

/* Бейдж расширения при ошибке в поле */
.rename_row .form_input.input_error + .file_ext_badge {
	border-color: #dc3545;
}

/* Текст ошибки под полем */
.form_error_text {
	display: none;
	color: #dc3545;
	font-size: 13px;
	margin-top: 6px;
	font-weight: 500;
}
