/* ==============================================
   OccupationalSafetyAppV2 - Mobile-first styles
   Prefix: osm- (Occupational Safety Mobile)
   ============================================== */

/* ========== LAYOUT ========== */

.osm-screen {
	padding: 12px 8px 24px 8px;
}

.osm-loading {
	text-align: center;
	padding: 40px 16px;
	color: var(--rd-gray-text-color, #6b7280);
	font-size: 0.95rem;
}

.osm-empty {
	text-align: center;
	padding: 32px 16px;
	color: var(--rd-gray-text-color, #6b7280);
	font-size: 0.9rem;
}

.osm-mt {
	margin-top: 24px;
}

/* ========== SCREEN HEADER ========== */

.osm-screen-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}

.osm-screen-title {
	font-size: 1.15rem;
	font-weight: 600;
	margin: var(--rd-spacing-md) 0;
	color: var(--rd-text-color, #1f2937);
}

.osm-detail-actions {
	display: flex;
	gap: 12px;
}

/* ========== BADGES ========== */

.osm-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: 600;
	white-space: nowrap;
}

.osm-badge-category {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 8px;
	font-size: 0.75rem;
	font-weight: 600;
	white-space: nowrap;
}

.osm-badge-sm {
	padding: 1px 6px;
	font-size: 0.7rem;
}

.osm-badge-green {
	background-color: #dcfce7;
	color: #15803d;
}

.osm-badge-gray {
	background-color: #f3f4f6;
	color: #6b7280;
}

.osm-badge-yellow {
	background-color: #fef9c3;
	color: #a16207;
}

.osm-badge-overdue {
	background-color: #fee2e2;
	color: #dc2626;
}

.osm-risk-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 8px;
	font-size: 0.75rem;
	font-weight: 600;
}

/* ========== CARD LIST ========== */

.osm-card-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.osm-card {
	background: #fff;
	border: 1px solid var(--rd-border-color, #e5e7eb);
	border-radius: 12px;
	padding: 14px 16px;
	cursor: pointer;
	transition: box-shadow 0.15s;
}

.osm-card:active {
	box-shadow: 0 0 0 2px var(--rd-primary-active, #d66181)33;
}

.osm-card-compact {
	padding: 10px 14px;
}

.osm-card-top {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
	flex-wrap: wrap;
}

.osm-card-title {
	font-size: 0.95rem;
	font-weight: 600;
	margin: 0 0 2px;
	color: var(--rd-text-color, #1f2937);
}

.osm-card-subtitle {
	font-size: 0.82rem;
	color: var(--rd-gray-text-color, #6b7280);
	margin: 0 0 8px;
}

.osm-card-footer {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
}

.osm-card-stat {
	font-size: 0.8rem;
	color: var(--rd-gray-text-color, #6b7280);
}

.osm-card-date {
	font-size: 0.78rem;
	color: var(--rd-gray-text-color, #6b7280);
}

.osm-card-chevron {
	margin-left: auto;
	font-size: 1.2rem;
	color: var(--rd-gray-text-color, #c0c0c0);
	font-weight: 300;
}

/* ========== DETAIL VIEWS ========== */

.osm-detail-header {
	margin-bottom: 16px;
}

.osm-detail-title {
	font-size: 1.15rem;
	font-weight: 600;
	margin: 8px 0 2px;
	color: var(--rd-text-color, #1f2937);
}

.osm-detail-subtitle {
	font-size: 0.88rem;
	color: var(--rd-gray-text-color, #6b7280);
	margin: 0 0 4px;
}

.osm-detail-description {
	font-size: 0.88rem;
	color: var(--rd-text-color, #374151);
	line-height: 1.5;
	margin: 0 0 16px;
}

.osm-btn-danger {
	color: #dc2626 !important;
}

/* ========== META GRID ========== */

.osm-meta-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 16px;
	background: var(--rd-bg-subtle, #f9fafb);
	border-radius: 10px;
	padding: 12px;
}

.osm-meta-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.osm-meta-label {
	font-size: 0.72rem;
	color: var(--rd-gray-text-color, #6b7280);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.osm-meta-value {
	font-size: 0.88rem;
	color: var(--rd-text-color, #1f2937);
	font-weight: 500;
}

/* ========== ACTION BUTTONS (Assessment Detail) ========== */

.osm-action-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.osm-action-btn {
	display: flex;
	align-items: center;
	gap: 14px;
	background: #fff;
	border: 1px solid var(--rd-border-color, #e5e7eb);
	border-radius: 12px;
	padding: 14px 16px;
	cursor: pointer;
	width: 100%;
	text-align: left;
}

.osm-action-btn:active {
	background: var(--rd-bg-subtle, #f9fafb);
}

.osm-action-icon {
	font-size: 1.5rem;
}

.osm-action-text {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.osm-action-title {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--rd-text-color, #1f2937);
}

.osm-action-count {
	font-size: 0.8rem;
	color: var(--rd-gray-text-color, #6b7280);
}

/* ========== SECTION HEADER ========== */

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

.osm-section-title {
	font-size: 1rem;
	font-weight: 600;
	margin: 0;
	color: var(--rd-text-color, #1f2937);
}

/* ========== IMAGES ========== */

.osm-image-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin-bottom: 16px;
}

.osm-image-thumb {
	display: block;
	border-radius: 8px;
	overflow: hidden;
	aspect-ratio: 1;
}

.osm-image-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ========== INSPECTION ========== */

.osm-inspection-upload {
	background: var(--rd-bg-subtle, #f9fafb);
	border-radius: 12px;
	padding: 16px;
	margin-bottom: 16px;
}

.osm-instruction-text {
	font-size: 0.88rem;
	color: var(--rd-gray-text-color, #6b7280);
	margin: 0 0 12px;
}

.osm-file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
	pointer-events: none;
}

.osm-file-upload-label {
	display: block;
	cursor: pointer;
}

.osm-file-upload-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 24px 16px;
	border: 2px dashed var(--rd-border-color, #d1d5db);
	border-radius: 10px;
	background: #fff;
	color: var(--rd-text-color, #374151);
	font-size: 0.9rem;
	font-weight: 500;
	transition: border-color 0.15s, background 0.15s;
}

.osm-file-upload-btn:active {
	background: var(--rd-bg-subtle, #f3f4f6);
	border-color: var(--rd-primary-active, #d66181);
}

.osm-file-upload-icon {
	font-size: 1.5rem;
}

.osm-file-upload-info {
	font-size: 0.78rem;
	color: var(--rd-gray-text-color, #9ca3af);
	font-weight: 400;
}

.osm-file-preview-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
	gap: 8px;
	margin-top: 12px;
}

.osm-file-preview {
	aspect-ratio: 1;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid var(--rd-border-color, #e5e7eb);
}

.osm-file-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.osm-file-count {
	font-size: 0.82rem;
	color: var(--rd-gray-text-color, #6b7280);
	margin: 8px 0 0;
	text-align: center;
}

.osm-analyze-btn {
	margin-top: 12px;
	width: 100%;
	padding: 14px;
	font-size: 0.95rem;
}

.osm-loading-overlay {
	text-align: center;
	padding: 32px 16px;
	background: var(--rd-bg-subtle, #f9fafb);
	border-radius: 12px;
	margin-bottom: 16px;
}

.osm-loading-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid var(--rd-border-color, #e5e7eb);
	border-top-color: var(--rd-primary-active, #d66181);
	border-radius: 50%;
	animation: osm-spin 0.8s linear infinite;
	margin: 0 auto 12px;
}

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

.osm-error-box {
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 12px;
	padding: 16px;
	margin-bottom: 16px;
	text-align: center;
}

.osm-error-box p {
	color: #dc2626;
	margin: 0 0 12px;
	font-size: 0.88rem;
}

/* ========== ANALYSIS RESULTS ========== */

.osm-analysis-result {
	margin-bottom: 16px;
}

.osm-analysis-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

.osm-ai-label {
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--rd-text-color, #1f2937);
}

.osm-analysis-stats {
	display: flex;
	gap: 6px;
}

/* ========== SUGGESTION CARDS ========== */

.osm-suggestion-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.osm-suggestion-card {
	background: #fff;
	border: 1px solid var(--rd-border-color, #e5e7eb);
	border-radius: 12px;
	overflow: hidden;
}

.osm-suggestion-accepted {
	opacity: 0.7;
	border-color: #86efac;
}

.osm-suggestion-rejected {
	opacity: 0.5;
	border-color: #d1d5db;
}

.osm-suggestion-image {
	width: 100%;
	aspect-ratio: 16/9;
	overflow: hidden;
}

.osm-suggestion-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.osm-suggestion-body {
	padding: 12px 14px;
}

.osm-suggestion-title {
	font-size: 0.95rem;
	font-weight: 600;
	margin: 8px 0 4px;
	color: var(--rd-text-color, #1f2937);
}

.osm-suggestion-desc {
	font-size: 0.82rem;
	color: var(--rd-gray-text-color, #6b7280);
	margin: 0 0 8px;
	line-height: 1.4;
}

.osm-suggestion-edit-input {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin-top: 8px;
	padding: 8px 10px;
	border: 1px solid var(--rd-border-color, #e5e7eb);
	border-radius: 8px;
	font-size: 0.88rem;
	font-family: inherit;
}

.osm-suggestion-risk {
	display: flex;
	gap: 12px;
	margin: 8px 0;
}

.osm-risk-mini {
	font-size: 0.78rem;
	font-weight: 600;
}

.osm-suggestion-actions {
	display: flex;
	gap: 10px;
	margin-top: 10px;
}

.osm-suggestion-actions-inline {
	margin-top: 0;
}

.osm-btn-sm {
	padding: 6px 14px !important;
	font-size: 0.82rem !important;
}

/* ========== SUGGESTION ROW (Inspection Detail) ========== */

.osm-suggestion-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 10px 0;
	border-bottom: 1px solid var(--rd-border-color, #f0f0f0);
}

.osm-suggestion-row:last-child {
	border-bottom: none;
}

.osm-suggestion-row-title {
	flex: 1;
	font-size: 0.88rem;
	color: var(--rd-text-color, #1f2937);
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}


@media screen and (max-width: 600px) {

	/* This should be applied to all buttons but since there is no real concepr right now its only applied for OS */
	pc-os-appv2 {

		.rd-primary-btn,
		.rd-secondary-btn,
		.rd-primary-btn-outline,
		.rd-secondary-btn-outline {
			width: 100% !important;
		}
	}

}