* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	line-height: 1.6;
	color: #333;
	background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
	min-height: 100vh;
	padding: 5px;
}

.app-container {
	max-width: 100%;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	height: 100vh;
	background: white;
	border-radius: 8px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	position: relative;
}

header {
	padding: 10px 15px;
	background: #2c3e50;
	color: white;
	text-align: center;
	transition: transform 0.3s ease;
}

.header-hidden {
	transform: translateY(-100%);
}

h1 {
	font-size: 1.2rem;
	margin-bottom: 3px;
}

.status-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 6px 15px;
	background: #34495e;
	color: white;
	font-size: 0.8rem;
}

.status-bar .highlight {
	background-color: #f39c12;
	color: #2c3e50;
	padding: 2px 4px;
	border-radius: 3px;
	font-weight: bold;
	font-size: 0.75rem;
}

.main-content {
	display: flex;
	flex: 1;
	overflow: hidden;
	position: relative;
}

.transcription-panel {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.panel-header {
	padding: 10px 15px;
	background: #f8f9fa;
	border-bottom: 1px solid #eaeaea;
	font-weight: bold;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.9rem;
}

.transcription-container {
	flex: 1;
	overflow-y: auto;
	padding: 8px;
	background: #fafafa;
	-webkit-overflow-scrolling: touch; /* Улучшает скроллинг на iOS */
}

.segment {
	background-color: white;
	border-radius: 6px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
	padding: 10px;
	margin-bottom: 10px;
	transition: transform 0.2s, box-shadow 0.2s;
	border-left: 3px solid #3498db;
	font-size: 0.9rem;
}

.segment:hover {
	transform: translateY(-1px);
	box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.segment.updating {
	background-color: #fff8e1;
	animation: pulse 1s infinite;
}

@keyframes pulse {
	0% { background-color: #fff8e1; }
	50% { background-color: #ffecb3; }
	100% { background-color: #fff8e1; }
}

.speaker-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
	padding-bottom: 4px;
	border-bottom: 1px solid #eee;
	font-size: 0.85rem;
}

.speaker-name {
	font-weight: bold;
	color: #2c3e50;
}

.speaker-time {
	color: #7f8c8d;
	font-size: 0.8rem;
}

.speaker-text {
	line-height: 1.4;
}

.controls-panel {
	position: fixed;
	top: 0;
	right: -300px;
	width: 300px;
	height: 100%;
	display: flex;
	flex-direction: column;
	padding: 15px;
	background: #f8f9fa;
	border-left: 1px solid #eee;
	transition: transform 0.3s ease;
	z-index: 100;
	overflow-y: auto;
}

.controls-panel.open {
	transform: translateX(-300px);
}

.control-group {
	margin-bottom: 15px;
}

.control-group h3 {
	margin-bottom: 10px;
	color: #2c3e50;
	font-size: 1rem;
}

.btn {
	display: block;
	width: 100%;
	padding: 8px 10px;
	margin-bottom: 6px;
	background-color: #3498db;
	color: white;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	transition: background-color 0.2s;
	font-weight: 500;
	text-align: center;
	font-size: 0.85rem;
}

.btn:hover {
	background-color: #2980b9;
}

.btn-active {
	background-color: #2ecc71;
}

.btn-pause {
	background-color: #f39c12;
}

.btn-pause:hover {
	background-color: #e67e22;
}

.btn-stop {
	background-color: #e74c3c;
}

.btn-stop:hover {
	background-color: #c0392b;
}

.btn-scroll {
	background-color: #9b59b6;
}

.btn-scroll:hover {
	background-color: #8e44ad;
}

.form-group {
	margin-bottom: 10px;
}

label {
	display: block;
	margin-bottom: 4px;
	font-weight: 500;
	color: #2c3e50;
	font-size: 0.85rem;
}

select, input {
	width: 100%;
	padding: 6px;
	border: 1px solid #ddd;
	border-radius: 5px;
	font-size: 0.85rem;
}

.auto-scroll {
	display: flex;
	align-items: center;
	margin-top: 6px;
}

.auto-scroll input {
	width: auto;
	margin-right: 6px;
}

footer {
	padding: 8px 15px;
	background: #ecf0f1;
	text-align: center;
	color: #7f8c8d;
	font-size: 0.75rem;
	transition: transform 0.3s ease;
}

.footer-hidden {
	transform: translateY(100%);
}

.loading {
	padding: 15px;
	text-align: center;
	color: #7f8c8d;
}

/* Стили для индикатора уровня микрофона */
.volume-container {
	margin-top: 10px;
}

.volume-bar {
	height: 6px;
	background: #ecf0f1;
	border-radius: 3px;
	margin-top: 4px;
	overflow: hidden;
}

.volume-level {
	height: 100%;
	background: #2ecc71;
	width: 0%;
	transition: width 0.3s, background-color 0.3s;
}

/* Стили для сообщений об ошибках */
.error-message {
	position: fixed;
	top: 10px;
	right: 10px;
	background: #e74c3c;
	color: white;
	padding: 10px;
	border-radius: 5px;
	box-shadow: 0 3px 8px rgba(0,0,0,0.15);
	z-index: 1000;
	max-width: 300px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	animation: slideIn 0.3s ease;
	font-size: 0.85rem;
}

.error-message .close-btn {
	background: none;
	border: none;
	color: white;
	font-size: 16px;
	cursor: pointer;
	margin-left: 8px;
}

@keyframes slideIn {
	from { transform: translateX(100%); opacity: 0; }
	to { transform: translateX(0); opacity: 1; }
}

/* Кнопка переключения панели управления на мобильных */
.toggle-controls {
	position: fixed;
	right: 10px;
	top: 10px;
	background: #3498db;
	color: white;
	border: none;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	font-size: 18px;
	cursor: pointer;
	z-index: 10;
	box-shadow: 0 2px 5px rgba(0,0,0,0.2);
	display: flex;
	align-items: center;
	justify-content: center;
}



/* Стили для нового нижнего бара управления */
.mobile-controls-bar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: rgba(52, 73, 94, 0.95);
	padding: 8px 10px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	z-index: 50;
	box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.mobile-control-btn {
	background: none;
	border: none;
	color: white;
	font-size: 1.5rem;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color 0.2s;
}

.mobile-control-btn:active {
	background-color: rgba(255, 255, 255, 0.2);
}

.record-btn {
	background-color: #e74c3c;
	width: 60px;
	height: 60px;
	margin-top: -15px;
	box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.record-btn.recording {
	background-color: #2ecc71;
	color: green;
	/*color: #2c3e50; background-color: #2ecc71; rgba(52, 73, 94, 0.8);*/
	animation: pulse 1s infinite;
}

.volume-indicator {
	display: flex;
	align-items: center;
	background: rgba(0, 0, 0, 0.3);
	border-radius: 15px;
	padding: 5px 10px;
	color: white;
	font-size: 0.8rem;
}

.volume-fill {
	width: 30px;
	height: 5px;
	background: #2ecc71;
	margin-left: 5px;
	border-radius: 2px;
	position: relative;
	overflow: hidden;
}

.volume-level-mobile {
	height: 100%;
	background: #2ecc71;
	width: 50%;
	transition: width 0.3s;
}

/* Стили для уведомлений */
.notification {
	position: fixed;
	top: 10px;
	right: 10px;
	padding: 10px 15px;
	border-radius: 5px;
	color: white;
	z-index: 1000;
	box-shadow: 0 3px 8px rgba(0,0,0,0.15);
	animation: slideIn 0.3s ease, fadeOut 0.5s ease 2s forwards;
	font-size: 0.85rem;
}

.notification.success {
	background: #27ae60;
}

.notification.error {
	background: #e74c3c;
}

@keyframes fadeOut {
	from { opacity: 1; }
	to { opacity: 0; }
}

/* Адаптивные стили */
@media (min-width: 768px) {
	.mobile-controls-bar {
		display: none;
	}
	
	.toggle-header {
		display: none;
	}
	
	.app-container {
		height: 96vh;
		padding: 10px;
	}
	
	body {
		padding: 10px;
	}
	
	.controls-panel {
		position: relative;
		right: 0;
		width: 250px;
		height: auto;
		transform: none;
		border-left: 1px solid #eee;
	}
	
	.toggle-controls {
		display: none;
	}
}

@media (max-width: 767px) {
	.controls-panel {
		box-shadow: -2px 0 10px rgba(0,0,0,0.2);
	}
	
	.desktop-only {
		display: none;
	}
	
	header, footer {
		padding: 8px 10px;
	}
	
	.status-bar {
		padding: 5px 10px;
	}
	
	.transcription-container {
		padding-bottom: 70px; /* Чтобы контент не перекрывался нижним баром */
	}
	
	/* На мобильных скрываем header и footer по умолчанию */
	header, footer {
		transform: translateY(0);
		transition: transform 0.3s ease;
	}
	
	header.header-hidden {
		transform: translateY(-100%);
	}
	
	footer.footer-hidden {
		transform: translateY(100%);
	}
}

/* Затемнение фона при открытом меню */
.overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 99;
	display: none;
}

.overlay.visible {
	display: block;
}

/* Улучшенное управление касанием для мобильных */
.touch-friendly {
	touch-action: manipulation;
}
		
		
.notification.waiting {
    background: #3498db;
}

.status-waiting {
    color: #3498db;
    font-weight: bold;
}