/**
 * Document Vault Styles
 *
 * Styles for the Epic HQ document management interface.
 *
 * @package EM_Epic_HQ
 */

/* ==========================================================================
   Page Header
   ========================================================================== */

.em-portal-documents .em-portal-page__header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 2rem;
}

.em-portal-documents .em-portal-page__header-title h1 {
	margin: 0 0 0.25rem;
}

.em-portal-documents .em-portal-page__description {
	font-size: 0.875rem;
	color: var(--em-hq-text-muted, #6b7280);
	margin: 0;
}

@media (max-width: 640px) {
	.em-portal-documents .em-portal-page__header {
		flex-direction: column;
		align-items: stretch;
	}

	.em-portal-documents .em-portal-page__header .em-btn {
		width: 100%;
		justify-content: center;
	}
}

/* ==========================================================================
   Category Sections
   ========================================================================== */

.em-doc-categories {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.em-doc-category {
	background: var(--em-hq-bg-white, #fff);
	border-radius: var(--em-hq-radius-lg, 12px);
	box-shadow: var(--em-hq-shadow, 0 1px 3px rgba(0, 0, 0, 0.1));
	overflow: hidden;
}

.em-doc-category__header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.5rem;
	background: var(--em-hq-bg, #f3f4f6);
	border-bottom: 1px solid var(--em-hq-border, #e5e7eb);
}

.em-doc-category__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	background: var(--em-hq-bg-white, #fff);
	border-radius: var(--em-hq-radius, 6px);
	color: var(--em-hq-accent-dark, #5BB8C1);
}

.em-doc-category__icon svg {
	width: 20px;
	height: 20px;
}

.em-doc-category__title {
	flex: 1;
	font-size: 1rem;
	font-weight: 600;
	color: var(--em-hq-text, #1a1a1a);
	margin: 0;
}

.em-doc-category__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 0.5rem;
	background: var(--em-hq-bg-white, #fff);
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--em-hq-text-muted, #6b7280);
}

/* ==========================================================================
   Document List
   ========================================================================== */

.em-doc-list {
	padding: 1rem 1.5rem;
}

.em-doc-empty {
	text-align: center;
	padding: 1rem 0;
	font-size: 0.875rem;
	color: var(--em-hq-text-muted, #6b7280);
	margin: 0;
}

/* ==========================================================================
   Document Item
   ========================================================================== */

.em-doc-item {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	padding: 1rem;
	border-radius: var(--em-hq-radius, 6px);
	transition: background-color 0.15s ease;
}

.em-doc-item:hover {
	background: var(--em-hq-bg, #f3f4f6);
}

.em-doc-item + .em-doc-item {
	border-top: 1px solid var(--em-hq-border, #e5e7eb);
}

.em-doc-item--expired {
	background: #fef2f2;
}

.em-doc-item--expired:hover {
	background: #fee2e2;
}

.em-doc-item--expiring {
	background: #fffbeb;
}

.em-doc-item--expiring:hover {
	background: #fef3c7;
}

.em-doc-item__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: var(--em-hq-bg, #f3f4f6);
	border-radius: var(--em-hq-radius, 6px);
	color: var(--em-hq-text-muted, #6b7280);
	flex-shrink: 0;
}

.em-doc-item__icon svg {
	width: 20px;
	height: 20px;
}

.em-doc-item__info {
	flex: 1;
	min-width: 0;
}

.em-doc-item__name {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--em-hq-text, #1a1a1a);
	margin: 0 0 0.25rem;
	word-break: break-word;
}

.em-doc-item__description {
	font-size: 0.8125rem;
	color: var(--em-hq-text-muted, #6b7280);
	margin: 0 0 0.5rem;
	line-height: 1.4;
}

.em-doc-item__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	font-size: 0.75rem;
	color: var(--em-hq-text-muted, #6b7280);
}

.em-doc-item__date {
	display: inline-flex;
	align-items: center;
}

.em-doc-item__actions {
	display: flex;
	gap: 0.5rem;
	flex-shrink: 0;
}

@media (max-width: 640px) {
	.em-doc-item {
		flex-direction: column;
	}

	.em-doc-item__actions {
		width: 100%;
		justify-content: flex-start;
		padding-top: 0.75rem;
		border-top: 1px solid var(--em-hq-border, #e5e7eb);
		margin-top: 0.75rem;
	}
}

/* ==========================================================================
   Badges
   ========================================================================== */

.em-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.125rem 0.5rem;
	font-size: 0.6875rem;
	font-weight: 500;
	border-radius: 10px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.em-badge--info {
	background: #dbeafe;
	color: #1e40af;
}

.em-badge--warning {
	background: #fef3c7;
	color: #92400e;
}

.em-badge--danger {
	background: #fee2e2;
	color: #991b1b;
}

/* ==========================================================================
   Dropzone
   ========================================================================== */

.em-dropzone {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	border: 2px dashed var(--em-hq-border, #e5e7eb);
	border-radius: var(--em-hq-radius, 6px);
	background: var(--em-hq-bg, #f3f4f6);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.em-dropzone:hover,
.em-dropzone--active {
	border-color: var(--em-hq-accent, #73CDD6);
	background: rgba(115, 205, 214, 0.05);
}

.em-dropzone input[type="file"] {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.em-dropzone__icon {
	color: var(--em-hq-text-muted, #6b7280);
	margin-bottom: 0.75rem;
}

.em-dropzone__text {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--em-hq-text, #1a1a1a);
	margin: 0 0 0.25rem;
}

.em-dropzone__hint {
	font-size: 0.75rem;
	color: var(--em-hq-text-muted, #6b7280);
	margin: 0;
}

.em-dropzone__file {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	background: var(--em-hq-bg-white, #fff);
	border-radius: var(--em-hq-radius, 6px);
	border: 1px solid var(--em-hq-border, #e5e7eb);
	margin-top: 1rem;
}

.em-dropzone__filename {
	font-size: 0.875rem;
	color: var(--em-hq-text, #1a1a1a);
	max-width: 200px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.em-dropzone__remove {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	padding: 0;
	background: none;
	border: none;
	color: var(--em-hq-text-muted, #6b7280);
	cursor: pointer;
	font-size: 1.25rem;
	line-height: 1;
}

.em-dropzone__remove:hover {
	color: var(--em-hq-error, #ef4444);
}

/* File selected state */
.em-dropzone--has-file .em-dropzone__icon,
.em-dropzone--has-file .em-dropzone__text,
.em-dropzone--has-file .em-dropzone__hint {
	opacity: 0.5;
}

.em-dropzone--has-file input[type="file"] {
	pointer-events: none;
}

/* ==========================================================================
   Form Help Text
   ========================================================================== */

.em-form-help {
	margin: 0.375rem 0 0;
	font-size: 0.75rem;
	color: var(--em-hq-text-muted, #6b7280);
}

/* ==========================================================================
   Button Loading State
   ========================================================================== */

.em-btn__loading {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.em-btn__loading::before {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: em-spin 0.8s linear infinite;
}

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

.em-btn:disabled .em-btn__text,
.em-btn--loading .em-btn__text {
	display: none;
}

.em-btn:disabled .em-btn__loading,
.em-btn--loading .em-btn__loading {
	display: inline-flex;
}

/* ==========================================================================
   Delete Modal
   ========================================================================== */

.em-modal__dialog--sm {
	max-width: 360px;
}

.em-doc-delete-name {
	font-weight: 600;
	color: var(--em-hq-text, #1a1a1a);
}

.em-btn--danger {
	background-color: var(--em-hq-error, #ef4444);
	color: #fff;
}

.em-btn--danger:hover:not(:disabled) {
	background-color: #dc2626;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 640px) {
	.em-doc-category__header {
		padding: 0.75rem 1rem;
	}

	.em-doc-list {
		padding: 0.75rem 1rem;
	}

	.em-doc-item {
		padding: 0.75rem;
	}

	.em-doc-item__icon {
		width: 32px;
		height: 32px;
	}

	.em-doc-item__icon svg {
		width: 16px;
		height: 16px;
	}

	.em-btn__text {
		display: none;
	}

	.em-doc-item__actions .em-btn {
		padding: 0.5rem;
	}
}
