/**
 * NW CouncilDocs Styles
 *
 * @package NW_CouncilDocs
 */

.nw-councildocs-archive {
	margin-bottom: 2rem;
}

/* Category Section */
.nw-councildocs-category-section {
	border-bottom: 2px solid #dee2e6;
	padding-bottom: 2rem;
	margin-bottom: 2.5rem;
}

.nw-councildocs-category-section:last-child {
	border-bottom: none;
	margin-bottom: 0;
}

/* Category Title */
.nw-councildocs-category-title {
	color: #495057;
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 1rem;
}

.nw-councildocs-category-title .badge {
	font-size: 0.875rem;
	font-weight: normal;
	margin-left: 0.5rem; /* Fallback for ms-2 if Bootstrap not loaded */
}

.nw-councildocs-category-title .ms-2 {
	margin-left: 0.5rem;
}

/* Year Selector */
.nw-councildocs-year-selector {
	padding: 0.75rem 0;
	margin-bottom: 1rem;
}

.nw-councildocs-year-selector p {
	margin-bottom: 0.5rem;
	color: #6c757d;
	font-size: 0.95rem;
}

.nw-councildocs-year-selector p strong {
	color: #495057;
}

/* Year Buttons */
.nw-councildocs-year-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.nw-councildocs-year-btn {
	padding: 0.5rem 1rem;
	border: 1px solid #dee2e6;
	background-color: #fff;
	color: #495057;
	cursor: pointer;
	transition: all 0.3s ease;
	border-radius: 0.25rem;
	font-size: 0.9rem;
	font-weight: 500;
}

.nw-councildocs-year-btn:hover {
	background-color: #f8f9fa;
	border-color: #adb5bd;
}

.nw-councildocs-year-btn.active {
	background-color: var(--bs-primary, #007bff);
	border-color: var(--bs-primary, #007bff);
	color: #fff;
	font-weight: 600;
}

/* Use Bootstrap primary color - fallback if CSS variables not available */
@supports not (--css: variables) {
	.nw-councildocs-year-btn.active {
		background-color: #007bff;
		border-color: #007bff;
	}
	
	.nw-councildocs-documents-container thead th {
		background-color: #007bff;
	}
}

/* Meetings Table */
.nw-councildocs-meetings-container {
	margin-top: 1.5rem;
}

.nw-councildocs-meetings-container table {
	background: #fff;
}

.nw-councildocs-meetings-container thead th {
	background-color: var(--bs-primary, #007bff);
	color: #fff;
	font-weight: 600;
	border-bottom: 2px solid rgba(0, 0, 0, 0.1);
	padding: 1rem;
}

.nw-councildocs-meetings-container tbody td {
	padding: 1rem;
	vertical-align: middle;
}

.nw-councildocs-meetings-container tbody tr:hover {
	background-color: #f8f9fa;
}

/* Document links (agenda/minutes) */
.nw-councildocs-doc-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	text-decoration: none;
	color: #495057;
	transition: color 0.2s ease;
	font-size: 0.9rem;
}

.nw-councildocs-doc-link:hover {
	color: var(--bs-primary, #007bff);
	text-decoration: underline;
}

.nw-councildocs-doc-link:hover .nw-councildocs-doc-icon {
	color: var(--bs-primary, #007bff);
}

.nw-councildocs-doc-icon {
	font-size: 1rem;
	color: #dc3545;
	transition: color 0.2s ease;
}

/* View All Button (Bootstrap) */
.nw-councildocs-view-supporting {
	white-space: nowrap;
}

.nw-councildocs-view-supporting .fas {
	font-size: 0.875rem;
}

/* Bootstrap button fallbacks if Bootstrap not loaded */
.nw-councildocs-view-supporting.btn {
	display: inline-block;
	font-weight: 400;
	text-align: center;
	text-decoration: none;
	vertical-align: middle;
	cursor: pointer;
	user-select: none;
	border: 1px solid transparent;
	padding: 0.375rem 0.75rem;
	font-size: 0.875rem;
	line-height: 1.5;
	border-radius: 0.25rem;
	transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.nw-councildocs-view-supporting.btn-sm {
	padding: 0.25rem 0.5rem;
	font-size: 0.875rem;
	line-height: 1.5;
	border-radius: 0.2rem;
}

.nw-councildocs-view-supporting.btn-outline-primary {
	color: #007bff;
	border-color: #007bff;
	background-color: transparent;
}

.nw-councildocs-view-supporting.btn-outline-primary:hover {
	color: #fff;
	background-color: #007bff;
	border-color: #007bff;
}

/* Bootstrap margin utilities fallback */
.nw-councildocs-view-supporting .me-1,
.nw-councildocs-supporting-link .me-2 {
	margin-right: 0.25rem;
}

.nw-councildocs-supporting-link .me-2 {
	margin-right: 0.5rem;
}

/* Supporting documents links */
.nw-councildocs-supporting-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: #495057;
	transition: color 0.2s ease;
}

.nw-councildocs-supporting-link:hover {
	color: var(--bs-primary, #007bff);
	text-decoration: underline;
}

.nw-councildocs-supporting-link:hover .fa-file-download {
	color: var(--bs-primary, #007bff);
}

.nw-councildocs-supporting-link .fa-file-download {
	color: #6c757d;
	transition: color 0.2s ease;
}

/* Loading State */
.nw-councildocs-meetings-container .spinner-border {
	width: 1rem;
	height: 1rem;
	border-width: 0.15em;
}

/* Responsive */
@media (max-width: 768px) {
	.nw-councildocs-tabs {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	
	.nw-councildocs-tabs .nav-link {
		padding: 0.5rem 1rem;
		white-space: nowrap;
	}
	
	.nw-councildocs-meetings-container {
		overflow-x: auto;
	}
	
	.nw-councildocs-meetings-container table {
		min-width: 600px;
	}
}

/* Supporting documents row */
.nw-councildocs-supporting-row td {
	background-color: #f8f9fa;
}

.nw-councildocs-supporting-list {
	margin: 0;
	padding-left: 1.25rem;
}

.nw-councildocs-supporting-list li {
	margin-bottom: 0.25rem;
}

/* Admin: Meeting meta box layout - Modern UI */
.nw-councildocs-meeting-meta {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 0;
	background: transparent;
	border: none;
}

/* Meta Section Container */
.nw-councildocs-meta-section {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	margin-bottom: 1.25rem;
	padding: 1.25rem 1.5rem;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.2s ease;
}

.nw-councildocs-meta-section:hover {
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.nw-councildocs-meta-section:last-child {
	margin-bottom: 0;
}

/* Section Headers */
.nw-councildocs-meta-section-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 2px solid #f0f0f1;
}

.nw-councildocs-meta-section-header .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	color: #2271b1;
	margin: 0;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: middle;
}

.nw-councildocs-meta-section-header .nw-councildocs-meta-label {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Field Rows */
.nw-councildocs-meta-row {
	display: flex;
	flex-wrap: wrap;
	column-gap: 1.5rem;
	row-gap: 1rem;
}

.nw-councildocs-meta-row--two-col .nw-councildocs-meta-field {
	flex: 1 1 calc(50% - 0.75rem);
	min-width: 280px;
}

.nw-councildocs-meta-field-wrapper {
	width: 100%;
}

/* Labels */
.nw-councildocs-meta-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
	color: #1d2327;
	font-size: 13px;
	line-height: 1.4;
}

.nw-councildocs-doc-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.nw-councildocs-doc-label .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #646970;
	margin: 0;
	line-height: 1;
	vertical-align: middle;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Input Controls */
.nw-councildocs-meta-control {
	max-width: 100%;
	padding: 8px 12px;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	font-size: 14px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nw-councildocs-meta-control:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}

.nw-councildocs-date-input {
	width: 100%;
	max-width: 280px;
}

.nw-councildocs-url-input.has-value {
	border-color: #00a32a;
	background-color: #f0f6fc;
}

/* Input Groups (URL + Button) */
.nw-councildocs-input-group {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.nw-councildocs-input-group .nw-councildocs-meta-control {
	flex: 1;
}

.nw-councildocs-input-group .button {
	flex-shrink: 0;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Media Buttons */
.nw-councildocs-media-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 6px 12px;
	font-size: 13px;
	height: auto;
	line-height: 1.5;
	vertical-align: middle;
}

.nw-councildocs-media-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	margin: 0;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: middle;
}

.nw-councildocs-media-btn:hover {
	background: #f0f0f1;
	border-color: #8c8f94;
}

/* Document Fields */
.nw-councildocs-doc-field {
	margin-bottom: 0;
}

/* Supporting Documents Section */
.nw-councildocs-supporting-wrapper {
	margin-top: 0.5rem;
}

.nw-councildocs-supporting-table {
	margin-top: 0;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	overflow: hidden;
}

.nw-councildocs-supporting-table thead {
	background: #f6f7f7;
}

.nw-councildocs-supporting-table th {
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #50575e;
	padding: 10px 12px;
	border-bottom: 2px solid #dcdcde;
}

.nw-councildocs-supporting-table tbody tr {
	transition: background-color 0.15s ease;
}

.nw-councildocs-supporting-table tbody tr:hover {
	background-color: #f9f9f9;
}

.nw-councildocs-supporting-table tbody td {
	padding: 10px 12px;
	vertical-align: middle;
	border-bottom: 1px solid #f0f0f1;
}

.nw-councildocs-supporting-table tbody tr:last-child td {
	border-bottom: none;
}

.nw-councildocs-supporting-table .text-center {
	text-align: center;
}

.nw-councildocs-supporting-table .nw-councildocs-input-group {
	margin: 0;
}

.nw-councildocs-supporting-table .button-small {
	padding: 4px 8px;
	height: auto;
	min-height: 30px;
	line-height: 1.2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: middle;
}

.nw-councildocs-supporting-table .button-small .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	margin: 0;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: middle;
}

.nw-councildocs-remove-row {
	color: #b32d2e;
	border-color: #b32d2e;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.nw-councildocs-remove-row:hover {
	background: #b32d2e;
	color: #fff;
	border-color: #b32d2e;
}

.nw-councildocs-remove-row .dashicons {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Add Document Button */
.nw-councildocs-add-doc-wrapper {
	margin-top: 1rem;
	margin-bottom: 0;
}

.nw-councildocs-add-doc-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 500;
	border-color: #2271b1;
	color: #2271b1;
	background: transparent;
	transition: all 0.2s ease;
}

.nw-councildocs-add-doc-btn .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	margin: 0;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: middle;
}

.nw-councildocs-add-doc-btn:hover {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
	.nw-councildocs-meta-row--two-col .nw-councildocs-meta-field {
		flex: 1 1 100%;
		min-width: 100%;
	}

	.nw-councildocs-input-group {
		flex-direction: column;
	}

	.nw-councildocs-input-group .button {
		width: 100%;
	}
}
