/**
 * Add From Server Reloaded - Styles
 *
 * @package Add From Server Reloaded
 * @since   4.0.0
 */

/* Original hidden file styles */
.afsrreloaded-wrap .widefat tbody tr.doesnt-meet-guidelines,
.afsrreloaded-wrap .widefat tbody tr.unreadable {
	background-color: #FFE8EE;
	display: none;
}

.afsrreloaded-wrap .widefat.showhidden tbody tr.doesnt-meet-guidelines,
.afsrreloaded-wrap .widefat.showhidden tbody tr.unreadable {
	display: table-row;
}

.afsrreloaded-wrap .widefat.showhidden .hidden-toggle {
	display: none;
}

/* Enhanced styles for better UX */
.afsrreloaded-wrap {
	max-width: 100%;
}

.afsrreloaded-file-table {
	margin-top: 10px;
}

.afsrreloaded-file-table thead td,
.afsrreloaded-file-table tfoot td {
	font-weight: 600;
}

.afsrreloaded-file-table tbody tr:not(.afsrreloaded-folder-row):hover {
	background-color: #f5f5f5;
}

.afsrreloaded-file-table tbody tr.afsrreloaded-disabled-row {
	opacity: 0.6;
}

.afsrreloaded-file-table tbody tr.afsrreloaded-disabled-row label {
	color: #a0a5aa;
	cursor: not-allowed;
}

.afsrreloaded-file-table tbody tr.doesnt-meet-guidelines label::after {
	content: " ⚠️";
	color: #d63638;
	font-size: 14px;
}

.afsrreloaded-file-table tbody tr.unreadable label::after {
	content: " 🔒";
	color: #d63638;
	font-size: 14px;
}

/* Directory link styling */
.afsrreloaded-file-table tbody tr td a {
	text-decoration: none;
	color: #2271b1;
	font-weight: 500;
}

.afsrreloaded-file-table tbody tr:not(.afsrreloaded-folder-row) td a:hover {
	color: #135e96;
	text-decoration: underline;
}

/* Hidden toggle link */
.afsrreloaded-file-table tbody tr.hidden-toggle a {
	color: #d63638;
	font-style: italic;
}

.afsrreloaded-file-table tbody tr.hidden-toggle a:hover {
	color: #b32d2e;
}

/* Search box styling */
.afsrreloaded-search-box {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 10px 12px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.afsrreloaded-search-box #afsrreloaded-file-search {
	flex: 1;
	margin: 0;
}

.afsrreloaded-search-box .button {
	margin: 0;
}

/* Import status */
.afsrreloaded-import-status {
	display: inline-block;
	vertical-align: middle;
	color: #2271b1;
	font-weight: 500;
}

.afsrreloaded-import-status .spinner {
	margin: 0 5px 0 0;
	vertical-align: middle;
}

/* File count */
.afsrreloaded-file-count {
	display: inline-block;
	font-size: 13px;
	color: #646970;
}

/* Current directory breadcrumb */
.afsrreloaded-current-directory {
	background: #fff !important;
	padding: 15px !important;
	border: 1px solid #ddd !important;
	border-radius: 4px !important;
	margin-bottom: 15px !important;
}

.afsrreloaded-location-label {
	color: #000 !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	display: block;
	margin-bottom: 8px;
}

#cwd {
	font-family: 'Courier New', monospace !important;
	background: #f8f9fa !important;
	padding: 10px 12px !important;
	border-radius: 3px !important;
	display: block !important;
	font-size: 14px !important;
	line-height: 1.8 !important;
	border: 1px solid #e0e0e0 !important;
	color: #000 !important;
	margin-top: 8px;
}

#cwd a {
	color: #000 !important;
	text-decoration: none !important;
	padding: 4px 8px !important;
	background: #fff !important;
	border-radius: 3px !important;
	margin: 0 2px !important;
	display: inline-block !important;
	border: 1px solid #ddd !important;
	font-weight: 500 !important;
}

#cwd a:hover {
	background: #2271b1 !important;
	color: #fff !important;
	text-decoration: none !important;
	border-color: #2271b1 !important;
}

/* Help section */
.afsrreloaded-help-section {
	background: #f9f9f9;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 20px;
}

.afsrreloaded-help-section h2 {
	margin-top: 0;
	font-size: 18px;
	border-bottom: 1px solid #dcdcde;
	padding-bottom: 10px;
}

.afsrreloaded-help-section pre.afsrreloaded-code-block {
	background: #f5f5f5;
	color: #000;
	padding: 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	overflow-x: auto;
	font-size: 13px;
	line-height: 1.5;
}

.afsrreloaded-help-section pre.afsrreloaded-code-block code {
	background: transparent;
	color: #000;
	padding: 0;
	font-family: 'Courier New', monospace;
	font-size: 13px;
	font-weight: 600;
}

.afsrreloaded-help-section code.afsrreloaded-inline-code {
	background: #f5f5f5;
	color: #000;
	padding: 3px 8px;
	border: 1px solid #ddd;
	border-radius: 3px;
	font-family: 'Courier New', monospace;
	font-size: 13px;
	font-weight: 600;
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
	.afsrreloaded-search-box {
		flex-direction: column;
		align-items: stretch;
	}

	.afsrreloaded-search-box #afsrreloaded-file-search {
		width: 100%;
	}

	.afsrreloaded-file-count {
		display: block;
		margin-top: 10px;
		margin-left: 0 !important;
	}

	.afsrreloaded-import-status {
		display: block;
		margin-top: 10px;
		margin-left: 0 !important;
	}
}

/* Success messages */
.notice.notice-success p em {
	font-style: normal;
	font-weight: 600;
	color: #2271b1;
}

/* Error messages */
.notice.notice-error p em {
	font-style: normal;
	font-weight: 600;
	color: #d63638;
}

/* Loading spinner enhancement */
.spinner.is-active {
	display: inline-block;
	background-size: 20px 20px;
	width: 20px;
	height: 20px;
	margin: 0;
	vertical-align: middle;
}

/* File size and date columns */
.afsrreloaded-file-table tbody tr td:nth-child(3),
.afsrreloaded-file-table tbody tr td:nth-child(4),
.afsrreloaded-file-table thead td:nth-child(3),
.afsrreloaded-file-table thead td:nth-child(4),
.afsrreloaded-file-table tfoot td:nth-child(3),
.afsrreloaded-file-table tfoot td:nth-child(4) {
	text-align: right;
	font-size: 12px;
	color: #646970;
	width: 120px;
	vertical-align: middle;
}

.afsrreloaded-file-table thead td:nth-child(3),
.afsrreloaded-file-table thead td:nth-child(4) {
	vertical-align: bottom;
}

/* Checkbox column */
.afsrreloaded-file-table .check-column {
	width: 50px;
	padding: 12px 10px;
	vertical-align: middle;
	text-align: center;
}

.afsrreloaded-file-table .check-column input[type="checkbox"] {
	margin: 0 auto;
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: #2271b1;
}

.afsrreloaded-file-table .check-column input[type="checkbox"]:hover:not(:disabled) {
	transform: scale(1.1);
	transition: transform 0.1s ease;
}

.afsrreloaded-file-table .check-column input[type="checkbox"]:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.afsrreloaded-file-table thead .check-column,
.afsrreloaded-file-table tfoot .check-column {
	vertical-align: middle;
}

/* Improved table spacing */
.afsrreloaded-file-table tbody tr td {
	padding: 12px 15px;
}

.afsrreloaded-file-table tbody tr th {
	padding: 12px 10px;
}

.afsrreloaded-file-table thead tr td,
.afsrreloaded-file-table tfoot tr td {
	padding: 12px 15px;
}

/* Parent folder highlight */
.afsrreloaded-file-table tbody tr td a[href*="Parent"] {
	color: #8c8f94;
	font-weight: 400;
}

.afsrreloaded-file-table tbody tr td a[href*="Parent"]::before {
	content: "⬆️ ";
}

/* Folder row styling */
.afsrreloaded-file-table tbody tr.afsrreloaded-folder-row {
	background: #f6f7f7;
	cursor: pointer;
}

.afsrreloaded-file-table tbody tr.afsrreloaded-folder-row:hover {
	background: #e8f4f8;
}

.afsrreloaded-file-table tbody tr.afsrreloaded-folder-row td a {
	color: #135e96;
	font-weight: 500;
	display: inline-block;
	padding: 5px 0;
	outline: none;
	text-decoration: none;
}

.afsrreloaded-file-table tbody tr.afsrreloaded-folder-row td a:focus {
	outline: none;
	box-shadow: none;
}

.afsrreloaded-file-table tbody tr.afsrreloaded-folder-row:hover td a {
	color: #0a4b78;
	text-decoration: none;
}

.afsrreloaded-file-table tbody tr.afsrreloaded-folder-row td small {
	display: inline-block;
	color: #646970;
	font-size: 12px;
	font-weight: 400;
	margin-left: 10px;
}

/* Accessibility improvements */
.afsrreloaded-file-table tbody tr:not(.afsrreloaded-folder-row):focus-within {
	outline: 2px solid #2271b1;
	outline-offset: -2px;
}

.afsrreloaded-file-table tbody tr.afsrreloaded-folder-row:focus-within {
	outline: none;
}

.afsrreloaded-file-table input[type="checkbox"]:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
	border-radius: 3px;
}

/* Print styles */
@media print {

	.afsrreloaded-search-box,
	.afsrreloaded-help-section,
	.afsrreloaded-import-status,
	.afsrreloaded-file-count,
	.check-column,
	.button {
		display: none !important;
	}
}