/* Document Reader Styles - Modern Design */

.document-reader-wrapper {
	background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 100%);
	min-height: 100vh;
	padding: 2rem 0;
}

.document-reader-container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

/* Page Header */
.page-header {
	margin-bottom: 3rem;
	padding-bottom: 2rem;
	border-bottom: 2px solid #e2e8f0;
}

.header-content {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.page-title {
	font-size: 2.5rem;
	font-weight: 700;
	margin: 0;
	color: #0f172a;
	display: flex;
	align-items: center;
	gap: 1rem;
	line-height: 1.2;
}

.title-icon {
	color: #3b82f6;
	flex-shrink: 0;
}

.page-subtitle {
	color: #64748b;
	font-size: 1.125rem;
	margin: 0;
	font-weight: 400;
}

/* Loading Spinner */
.loading-spinner {
	text-align: center;
	padding: 6rem 2rem;
}

.spinner-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.5rem;
}

.spinner {
	border: 5px solid #e2e8f0;
	border-top: 5px solid #3b82f6;
	border-radius: 50%;
	width: 56px;
	height: 56px;
	animation: spin 0.8s linear infinite;
}

.loading-text {
	font-size: 1.125rem;
	color: #64748b;
	font-weight: 500;
	margin: 0;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Dashboard */
.dashboard-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
	gap: 1rem;
}

.header-left {
	display: flex;
	align-items: center;
}

.file-count-badge {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	background: #f3f4f6;
	color: #374151;
	border-radius: 0.5rem;
}

.count-number {
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1;
}

.count-label {
	font-size: 0.875rem;
	font-weight: 400;
}

.header-right {
	display: flex;
	align-items: center;
}

.filter-controls {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.filter-label {
	font-size: 0.875rem;
	font-weight: 500;
	color: #475569;
	white-space: nowrap;
}

.filter-select {
	padding: 0.5rem 0.875rem;
	border: 1px solid #d1d5db;
	border-radius: 0.5rem;
	background: white;
	font-size: 0.875rem;
	color: #374151;
	cursor: pointer;
	transition: all 0.2s;
	min-width: 160px;
}

.filter-select:hover {
	border-color: #cbd5e1;
}

.filter-select:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Cases Container */
.cases-container {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin-bottom: 2rem;
}

/* Case Section */
.case-section {
	background: white;
	border: 1px solid #e5e7eb;
	border-radius: 0.75rem;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	transition: all 0.2s;
}

.case-section:hover {
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Case Header */
.case-header {
	padding: 1.5rem;
	cursor: pointer;
	background: linear-gradient(to right, #ffffff 0%, #f8fafc 100%);
	border-bottom: 1px solid #e5e7eb;
	transition: all 0.2s;
}

.case-header:hover {
	background: linear-gradient(to right, #f8fafc 0%, #f1f5f9 100%);
}

.case-header-left {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.case-toggle-icon {
	color: #64748b;
	transition: transform 0.3s ease;
	flex-shrink: 0;
}

.case-info {
	flex: 1;
	min-width: 0;
}

.case-title {
	font-size: 1.25rem;
	font-weight: 600;
	color: #0f172a;
	margin: 0 0 0.5rem 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.case-meta {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	font-size: 0.875rem;
}

.case-reg-number {
	color: #475569;
	font-weight: 500;
	padding: 0.25rem 0.625rem;
	background: #f1f5f9;
	border-radius: 0.375rem;
}

.case-status {
	padding: 0.25rem 0.625rem;
	border-radius: 0.375rem;
	font-weight: 500;
	font-size: 0.75rem;
	text-transform: uppercase;
}

.case-status-pending {
	background: #fef3c7;
	color: #92400e;
}

.case-status-inprogress {
	background: #fed7aa;
	color: #9a3412;
}

.case-status-disposed {
	background: #d1fae5;
	color: #065f46;
}

.case-status-noc {
	background: #fee2e2;
	color: #991b1b;
}

.case-file-count {
	color: #64748b;
	font-weight: 500;
}

/* Case Files */
.case-files {
	padding: 1.5rem;
	background: #f8fafc;
	border-top: 1px solid #e5e7eb;
}

.case-count-badge {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	background: #f3f4f6;
	color: #374151;
	border-radius: 0.5rem;
	margin-left: 1rem;
}

/* Files Grid */
.files-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1.5rem;
}

/* File Card */
.file-card {
	background: white;
	border: 1px solid #e5e7eb;
	border-radius: 0.75rem;
	padding: 1.5rem;
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	gap: 1.25rem;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.file-card:hover {
	border-color: #3b82f6;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.file-card-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	flex-shrink: 0;
	padding: 0.75rem;
	background: #f3f4f6;
	border-radius: 0.5rem;
}

.file-card-icon svg {
	width: 100%;
	height: 100%;
}

.file-card-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	min-width: 0;
}

.file-card-title {
	font-size: 1rem;
	font-weight: 500;
	color: #111827;
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	line-height: 1.5;
}

.file-card-meta {
	display: flex;
	align-items: center;
	gap: 1rem;
	font-size: 0.8125rem;
	color: #6b7280;
}

.file-size {
	color: #6b7280;
}

.file-type {
	background: #eff6ff;
	color: #3b82f6;
	padding: 0.25rem 0.625rem;
	border-radius: 0.375rem;
	font-weight: 500;
	font-size: 0.75rem;
}

/* Empty State */
.no-files-message {
	padding: 6rem 2rem;
	text-align: center;
}

.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.5rem;
	max-width: 500px;
	margin: 0 auto;
}

.empty-icon {
	width: 120px;
	height: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
	border-radius: 50%;
	color: #cbd5e1;
}

.empty-title {
	font-size: 1.5rem;
	font-weight: 600;
	color: #1e293b;
	margin: 0;
}

.empty-description {
	font-size: 1rem;
	color: #64748b;
	margin: 0;
	line-height: 1.6;
}

/* File Viewer Modal */
.file-viewer-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.8);
	backdrop-filter: blur(8px);
	animation: fadeIn 0.2s;
}

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

.modal-content-wrapper {
	position: relative;
	width: 95%;
	max-width: 1400px;
	max-height: 95vh;
	animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.modal-content {
	background: white;
	border-radius: 1rem;
	display: flex;
	flex-direction: column;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	overflow: hidden;
	max-height: 95vh;
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.5rem 2rem;
	border-bottom: 2px solid #f1f5f9;
	background: linear-gradient(to right, #ffffff 0%, #f8fafc 100%);
}

.modal-header-left {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex: 1;
	min-width: 0;
}

.modal-icon {
	color: #3b82f6;
	flex-shrink: 0;
}

.modal-title {
	font-size: 1.5rem;
	font-weight: 600;
	margin: 0;
	color: #0f172a;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.modal-close {
	background: #f1f5f9;
	border: none;
	color: #64748b;
	cursor: pointer;
	padding: 0.5rem;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 0.5rem;
	transition: all 0.2s;
	flex-shrink: 0;
	margin-left: 1rem;
}

.modal-close:hover {
	background: #e2e8f0;
	color: #1e293b;
	transform: scale(1.05);
}

.modal-close svg {
	width: 20px;
	height: 20px;
}

.modal-body {
	padding: 2rem;
	overflow: auto;
	flex: 1;
	min-height: 0;
	background: #f8fafc;
}

/* Viewer Loading */
.viewer-loading {
	text-align: center;
	padding: 6rem 2rem;
	color: #64748b;
	font-size: 1.125rem;
}

.viewer-error {
	text-align: center;
	padding: 4rem 2rem;
	color: #dc2626;
	background: #fef2f2;
	border-radius: 0.5rem;
	border: 2px solid #fecaca;
}

.viewer-error p {
	margin: 0 0 1rem;
	font-size: 1rem;
}

/* PDF Viewer */
.pdf-viewer-container {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.pdf-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem 1.5rem;
	background: white;
	border-radius: 0.75rem;
	font-size: 0.875rem;
	color: #475569;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pdf-toolbar button {
	padding: 0.5rem 1rem;
	background: #3b82f6;
	color: white;
	border: none;
	border-radius: 0.5rem;
	cursor: pointer;
	font-weight: 500;
	transition: all 0.2s;
}

.pdf-toolbar button:hover:not(:disabled) {
	background: #2563eb;
	transform: translateY(-1px);
}

.pdf-toolbar button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.pdf-canvas-container {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	background: #e2e8f0;
	padding: 2rem;
	border-radius: 0.75rem;
	min-height: 500px;
	overflow: auto;
}

.pdf-canvas-container canvas {
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
	background: white;
	border-radius: 0.5rem;
}

.pdf-viewer-fallback {
	width: 100%;
	height: 80vh;
	border-radius: 0.75rem;
	overflow: hidden;
}

.pdf-iframe {
	width: 100%;
	height: 100%;
	border: none;
}

/* Image Viewer */
.image-viewer {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 500px;
	background: #e2e8f0;
	border-radius: 0.75rem;
	padding: 2rem;
}

.viewer-image {
	max-width: 100%;
	max-height: 85vh;
	object-fit: contain;
	border-radius: 0.75rem;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
	background: white;
	padding: 1rem;
}

/* Text Viewer */
.text-viewer {
	background: white;
	border-radius: 0.75rem;
	padding: 2rem;
	max-height: 75vh;
	overflow: auto;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.text-content {
	margin: 0;
	font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Courier New', monospace;
	font-size: 0.875rem;
	line-height: 1.8;
	color: #1e293b;
	white-space: pre-wrap;
	word-wrap: break-word;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

/* Office Viewer */
.office-viewer,
.other-viewer {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 500px;
	padding: 3rem 2rem;
}

.office-info,
.file-info {
	text-align: center;
	max-width: 500px;
	background: white;
	padding: 3rem;
	border-radius: 1rem;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.office-icon,
.file-icon {
	display: flex;
	justify-content: center;
	margin-bottom: 2rem;
}

.office-info h3,
.file-info h3 {
	margin: 0 0 1rem;
	color: #0f172a;
	font-size: 1.5rem;
	font-weight: 600;
}

.office-info p,
.file-info p {
	margin: 0.75rem 0;
	color: #64748b;
	line-height: 1.6;
}

.text-muted {
	color: #94a3b8;
	font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
	.document-reader-wrapper {
		padding: 1rem 0;
	}

	.document-reader-container {
		padding: 0 1rem;
	}

	.page-title {
		font-size: 1.75rem;
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
	}

	.title-icon {
		width: 28px;
		height: 28px;
	}

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

	.dashboard-header {
		flex-direction: column;
		align-items: stretch;
		padding: 1.25rem;
	}

	.filter-controls {
		flex-direction: column;
		align-items: stretch;
		gap: 0.5rem;
	}

	.filter-select {
		width: 100%;
	}

	.cases-container {
		gap: 1rem;
	}

	.case-header {
		padding: 1.25rem;
	}

	.case-title {
		font-size: 1.125rem;
	}

	.case-meta {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
	}

	.case-files {
		padding: 1rem;
	}

	.files-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.file-card {
		padding: 1.5rem;
	}

	.modal-content-wrapper {
		width: 100%;
		max-height: 100vh;
		border-radius: 0;
	}

	.modal-content {
		border-radius: 0;
		max-height: 100vh;
	}

	.modal-header {
		padding: 1.25rem 1.5rem;
	}

	.modal-title {
		font-size: 1.25rem;
	}

	.modal-body {
		padding: 1.5rem;
	}
}

/* Prevent text selection in viewer */
.modal-body {
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

/* Disable drag and drop */
.file-card,
.modal-content {
	-webkit-user-drag: none;
}
