/* Minimal custom CSS for things Tailwind doesn't handle well */
.sidebar-width {
	width: 260px;
	min-width: 260px;
}

.main-ml {
	margin-left: 260px;
}

.login-error:not(.show) {
	display: none;
}

.login-error.show {
	display: block;
}

.dashboard:not(.active) {
	display: none;
}

.dashboard.active {
	display: flex;
}

.page:not(.active) {
	display: none;
}

.page.active {
	display: block;
}

/* Integrations page needs flex display when active */
#page-integrations.active {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.modal-overlay:not(.active) {
	display: none;
}

.modal-overlay.active {
	display: flex;
}

.nav-item.active {
	background: rgba(88, 166, 255, 0.1);
	color: #58a6ff;
}

.field-item.selected {
	border-color: #58a6ff;
	background: rgba(88, 166, 255, 0.05);
}

.theme-card.active {
	border-color: #3fb950;
}

.tag-btn.active {
	background: #58a6ff;
	border-color: #58a6ff;
	color: #fff;
}

.tag-btn.active:hover {
	color: #fff;
}

.submission-tab.active {
	background: rgba(88, 166, 255, 0.1);
	color: #58a6ff;
}

.submission-read {
	opacity: 0.5;
}

.settings-tab.active {
	background: rgba(88, 166, 255, 0.1);
	color: #58a6ff;
}

.settings-tab-content.hidden {
	display: none;
}

.posts-tab.active {
	background: rgba(88, 166, 255, 0.1);
	color: #58a6ff;
}

.support-tab.active {
	background: rgba(88, 166, 255, 0.1);
	color: #58a6ff;
}

.support-tab-content.hidden {
	display: none;
}

/* Post Editor Styles */
#postEditor {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#postEditor.active {
	display: flex;
}

.editor-tool-btn {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	color: #9ca3af;
	transition: all 0.15s;
	background: transparent;
	border: none;
	cursor: pointer;
}

.editor-tool-btn:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.editor-tool-btn.active {
	background: rgba(88, 166, 255, 0.2);
	color: #58a6ff;
}

.editor-view-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	color: #6b7280;
	background: transparent;
	border: none;
	cursor: pointer;
	transition: all 0.15s;
}

.editor-view-btn:hover {
	color: #9ca3af;
}

.editor-view-btn.active {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.editor-view-btn i {
	font-size: 12px;
}

#editorContent::placeholder {
	white-space: pre-wrap;
}

/* Markdown Preview Styles */
.prose {
	color: #e5e7eb;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
	color: #fff;
	font-weight: 700;
	margin-top: 1.5em;
	margin-bottom: 0.5em;
}

.prose h1 {
	font-size: 2.25em;
}

.prose h2 {
	font-size: 1.75em;
}

.prose h3 {
	font-size: 1.375em;
}

.prose p {
	margin-bottom: 1em;
	line-height: 1.75;
}

.prose a {
	color: #58a6ff;
	text-decoration: underline;
}

.prose strong {
	color: #fff;
	font-weight: 600;
}

.prose em {
	font-style: italic;
}

.prose code {
	background: rgba(255, 255, 255, 0.1);
	padding: 0.2em 0.4em;
	border-radius: 4px;
	font-size: 0.875em;
}

.prose pre {
	background: #1a1a1a;
	padding: 1em;
	border-radius: 8px;
	overflow-x: auto;
	margin: 1em 0;
}

.prose pre code {
	background: transparent;
	padding: 0;
}

.prose blockquote {
	border-left: 4px solid #58a6ff;
	padding-left: 1em;
	margin: 1em 0;
	color: #9ca3af;
	font-style: italic;
}

.prose ul,
.prose ol {
	padding-left: 1.5em;
	margin: 1em 0;
}

.prose li {
	margin: 0.5em 0;
}

.prose hr {
	border: none;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	margin: 2em 0;
}

.prose img {
	max-width: 100%;
	border-radius: 8px;
	margin: 1em 0;
}

@media (max-width: 1024px) {
	#editorSidebar.mobile-open {
		display: block;
		position: fixed;
		right: 0;
		top: 0;
		bottom: 0;
		z-index: 50;
	}
}

.nav-item-row {
	cursor: grab;
	transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.nav-item-row:active {
	cursor: grabbing;
}

.nav-item-row.dragging {
	opacity: 0.5;
	transform: scale(1.02);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	z-index: 10;
}

.nav-item-row.drag-over {
	border-color: #58a6ff;
	background: rgba(88, 166, 255, 0.1);
}

.nav-item-row.drag-above::before {
	content: '';
	position: absolute;
	top: -6px;
	left: 0;
	right: 0;
	height: 3px;
	background: #58a6ff;
	border-radius: 2px;
}

.nav-item-row.drag-below::after {
	content: '';
	position: absolute;
	bottom: -6px;
	left: 0;
	right: 0;
	height: 3px;
	background: #58a6ff;
	border-radius: 2px;
}

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

.spinner {
	animation: spin 0.8s linear infinite;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes slideIn {
	from {
		transform: translateX(100%);
		opacity: 0;
	}

	to {
		transform: translateX(0);
		opacity: 1;
	}
}

.toast {
	animation: slideIn 0.3s ease;
}

/* Sidebar overlay - hidden by default */
#sidebarOverlay {
	display: none;
}

/* Mobile sidebar */
@media (max-width: 768px) {
	.sidebar-width {
		transform: translateX(-100%);
		transition: transform 0.3s ease;
		z-index: 100;
	}

	.sidebar-width.open {
		transform: translateX(0);
	}

	#sidebarOverlay.open {
		display: block;
	}

	.main-ml {
		margin-left: 0;
	}

	.mobile-menu-btn {
		display: flex !important;
	}
}

/* Content Cards */
.content-card {
	background: linear-gradient(145deg, #1e2128 0%, #161b22 100%);
	border: 1px solid #30363d;
	border-radius: 16px;
	padding: 1.5rem;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
}

.content-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, #8b5cf6, #d946ef);
	opacity: 0;
	transition: opacity 0.25s;
}

.content-card:hover {
	border-color: #8b5cf6;
	transform: translateY(-2px);
	box-shadow: 0 12px 40px rgba(139, 92, 246, 0.15);
}

.content-card:hover::before {
	opacity: 1;
}

.content-card.editing {
	border-color: #8b5cf6;
	box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.content-card .card-key {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 0.75rem;
	color: #8b5cf6;
	background: rgba(139, 92, 246, 0.1);
	padding: 0.25rem 0.75rem;
	border-radius: 9999px;
	display: inline-block;
}

.content-card .card-value {
	background: #0d1117;
	border: 1px solid #30363d;
	border-radius: 10px;
	padding: 0.875rem 1rem;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: #e5e7eb;
	transition: border-color 0.2s, box-shadow 0.2s;
	resize: none;
	min-height: 80px;
}

.content-card .card-value:focus {
	outline: none;
	border-color: #8b5cf6;
	box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.content-card .card-actions {
	opacity: 0;
	transition: opacity 0.2s;
}

.content-card:hover .card-actions {
	opacity: 1;
}

.content-card-enter {
	animation: cardEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cardEnter {
	from {
		opacity: 0;
		transform: translateY(20px) scale(0.95);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.content-card-exit {
	animation: cardExit 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cardExit {
	to {
		opacity: 0;
		transform: translateY(-10px) scale(0.95);
	}
}

.card-action-btn {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	color: #6b7280;
	cursor: pointer;
	transition: all 0.15s;
}

.card-action-btn:hover {
	background: rgba(139, 92, 246, 0.15);
	color: #a78bfa;
}

.card-action-btn.delete:hover {
	background: rgba(239, 68, 68, 0.15);
	color: #f87171;
}

/* Extra small breakpoint for very small phones */
@media (min-width: 480px) {
	.xs\:inline {
		display: inline;
	}
}

@media (max-width: 479px) {
	.hidden.xs\:inline {
		display: none;
	}
}

/* Hide scrollbar utility */
.hide-scrollbar {
	-ms-overflow-style: none !important;
	scrollbar-width: none !important;
	-webkit-overflow-scrolling: touch;
}

.hide-scrollbar::-webkit-scrollbar {
	display: none !important;
	width: 0 !important;
	height: 0 !important;
	background: transparent !important;
}

/* Integration filter button active state */
.integration-filter-btn.active {
	background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
	color: white;
}

/* Integration App Store Detail View */
#integration-detail {
	animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
	from {
		opacity: 0;
		transform: translateX(30px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}


/* Integration detail action bar blur effect */
#detail-action-bar {
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

/* Integration icon shadow */
#detail-icon {
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Line clamp utilities */
.line-clamp-2 {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Premium Support Button - iOS Shimmer Style */
.support-special-btn.active {
	background: rgba(124, 58, 237, 0.15);
	border-color: #7c3aed;
}

.support-shimmer-text {
	background: linear-gradient(
		90deg,
		#a78bfa 0%,
		#e0d5ff 25%,
		#ffffff 50%,
		#e0d5ff 75%,
		#a78bfa 100%
	);
	background-size: 200% 100%;
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
	0% {
		background-position: -200% center;
	}
	100% {
		background-position: 200% center;
	}
}

/* Custom Select Dropdown */
.custom-select-wrapper {
	position: relative;
}

.custom-select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background: #0d1117;
	border: 2px solid #30363d;
	border-radius: 12px;
	padding: 14px 40px 14px 16px;
	font-size: 0.9375rem;
	color: #e5e7eb;
	cursor: pointer;
	transition: all 0.2s;
	width: 100%;
	background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238b92a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
}

.custom-select:hover {
	border-color: #7c3aed;
	background-color: rgba(124, 58, 237, 0.05);
}

.custom-select:focus {
	outline: none;
	border-color: #7c3aed;
	box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
	background-color: rgba(124, 58, 237, 0.05);
}

/* Custom Textarea */
.custom-textarea {
	background: #0d1117;
	border: 2px solid #30363d;
	border-radius: 12px;
	padding: 14px 16px;
	font-size: 0.9375rem;
	color: #e5e7eb;
	transition: all 0.2s;
	resize: vertical;
	min-height: 120px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	line-height: 1.6;
	width: 100%;
}

.custom-textarea:hover {
	border-color: #7c3aed;
	background-color: rgba(124, 58, 237, 0.05);
}

.custom-textarea:focus {
	outline: none;
	border-color: #7c3aed;
	box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
	background-color: rgba(124, 58, 237, 0.05);
}

.custom-textarea::placeholder {
	color: #6b7280;
}

/* Custom Input */
.custom-input {
	background: #0d1117;
	border: 2px solid #30363d;
	border-radius: 12px;
	padding: 14px 16px;
	font-size: 0.9375rem;
	color: #e5e7eb;
	transition: all 0.2s;
	width: 100%;
}

.custom-input:hover {
	border-color: #7c3aed;
	background-color: rgba(124, 58, 237, 0.05);
}

.custom-input:focus {
	outline: none;
	border-color: #7c3aed;
	box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
	background-color: rgba(124, 58, 237, 0.05);
}

.custom-input::placeholder {
	color: #6b7280;
}

/* Form Label */
.form-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	color: #c9d1d9;
	margin-bottom: 8px;
	letter-spacing: 0.01em;
}

.form-label-required::after {
	content: '*';
	color: #f85149;
	margin-left: 4px;
}

/* Support Section Enhancements */
.support-tab.active {
	color: white;
	border-color: #7c3aed !important;
}

.support-tab:hover {
	background-color: rgba(124, 58, 237, 0.1);
}

/* Extra small breakpoint for mobile */
@media (min-width: 475px) {
	.xs\:inline {
		display: inline;
	}
	.xs\:inline-flex {
		display: inline-flex;
	}
	.hidden.xs\:inline {
		display: inline;
	}
	.hidden.xs\:inline-flex {
		display: inline-flex;
	}
}

/* Mobile optimizations for support cards */
@media (max-width: 640px) {
	.support-tab-content .space-y-4 {
		gap: 0.75rem;
	}
}