/**
 * Support-Tab CSS - FluentSupport Design
 */

/* ============================================
   FLUENTSUPPORT STYLE - SECTION LAYOUT
   ============================================ */

.fs-section {
	background: #fff;
	border-radius: 8px;
	border: 1px solid #e4e7ed;
	padding: 20px;
	margin-bottom: 20px;
}

.fs-section-secondary {
	margin-top: 24px;
}

/* Section Header */
.fs-section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 15px;
}

.fs-section-title {
	display: flex;
	align-items: center;
	gap: 10px;
}

.fs-section-title .fs-icon {
	font-size: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
}

.fs-section-title h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #1e1e1e;
}

/* Section Controls */
.fs-section-controls {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

/* Search Wrapper */
.fs-search-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.fs-search-wrapper .fs-search-icon {
	position: absolute;
	left: 10px;
	font-size: 14px;
	pointer-events: none;
	opacity: 0.5;
}

.fs-search-wrapper input {
	padding: 8px 32px 8px 32px;
	border: 1px solid #e4e7ed;
	border-radius: 6px;
	font-size: 13px;
	min-width: 200px;
	background: #fff;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.fs-search-wrapper input:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.fs-search-wrapper input:disabled {
	background: #f5f7fa;
	cursor: not-allowed;
	opacity: 0.6;
}

.fs-search-wrapper .fs-search-clear,
.fs-search-wrapper .jira-search-clear {
	position: absolute;
	right: 4px;
	background: none;
	border: none;
	font-size: 12px;
	color: #909399;
	cursor: pointer;
	padding: 4px 6px;
	display: none;
	transition: color 0.2s;
	line-height: 1;
}

.fs-search-wrapper .fs-search-clear:hover,
.fs-search-wrapper .jira-search-clear:hover {
	color: #606266;
}

/* Filter Dropdown */
.fs-filter-wrapper select,
.fs-filter-wrapper .jira-contact-filter,
.fs-filter-wrapper .fs-contact-filter {
	padding: 8px 32px 8px 12px;
	border: 1px solid #e4e7ed;
	border-radius: 6px;
	font-size: 13px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23606266' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E") no-repeat right 10px center;
	appearance: none;
	cursor: pointer;
	min-width: 160px;
	transition: border-color 0.2s;
}

.fs-filter-wrapper select:focus {
	outline: none;
	border-color: #6366f1;
}

.fs-filter-wrapper select:disabled {
	background-color: #f5f7fa;
	cursor: not-allowed;
	opacity: 0.6;
}

/* Pagination Dropdown */
.fs-pagination-wrapper {
	display: flex;
	align-items: center;
}

.fs-pagination-wrapper select,
.fs-pagination-wrapper .fs-per-page-select,
.fs-pagination-wrapper .jira-per-page-select {
	padding: 8px 28px 8px 12px;
	border: 1px solid #e4e7ed;
	border-radius: 6px;
	font-size: 13px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23606266' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E") no-repeat right 8px center;
	appearance: none;
	cursor: pointer;
	min-width: 90px;
	transition: border-color 0.2s;
	color: #606266;
}

.fs-pagination-wrapper select:focus {
	outline: none;
	border-color: #6366f1;
}

.fs-pagination-wrapper select:disabled {
	background-color: #f5f7fa;
	cursor: not-allowed;
	opacity: 0.6;
}

/* Loading State */
.fs-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 40px 20px;
	color: #606266;
}

.fs-spinner {
	width: 24px;
	height: 24px;
	border: 3px solid #e4e7ed;
	border-top-color: #6366f1;
	border-radius: 50%;
	animation: fs-spin 0.8s linear infinite;
}

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

/* Empty State */
.fs-empty-state {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
	color: #909399;
	text-align: center;
}

.fs-empty-state .fs-empty-icon {
	font-size: 48px;
	margin-bottom: 12px;
	opacity: 0.5;
}

.fs-empty-state p {
	margin: 0;
	font-size: 14px;
}

/* No Contacts Warning */
.fs-no-contacts-warning {
	background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
	border: 1px solid #fdba74;
	border-radius: 8px;
	padding: 30px;
	text-align: center;
	margin: 10px 0;
}

.fs-no-contacts-warning .fs-warning-icon {
	font-size: 36px;
	margin-bottom: 25px;
}

.fs-no-contacts-warning h4 {
	margin: 0 0 8px 0;
	font-size: 16px;
	font-weight: 600;
	color: #c2410c;
}

.fs-no-contacts-warning p {
	margin: 0;
	color: #9a3412;
	font-size: 14px;
}

/* Archive Section */
.fs-archive-section,
.jira-archive-section {
	margin-top: 20px;
	border-top: 1px solid #e4e7ed;
	padding-top: 15px;
}

.fs-archive-toggle,
.jira-archive-toggle,
.fs-archive-toggle-style {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 10px 14px;
	background: #f5f7fa;
	border: 1px solid #e4e7ed;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	color: #606266;
	cursor: pointer;
	transition: all 0.2s;
}

.fs-archive-toggle:hover,
.jira-archive-toggle:hover,
.fs-archive-toggle-style:hover {
	background: #ebeef5;
	border-color: #d0d3d9;
}

.fs-archive-toggle .archive-icon,
.jira-archive-toggle .archive-icon,
.fs-archive-toggle-style .archive-icon {
	transition: transform 0.2s;
	font-size: 10px;
	display: inline-block;
}

.fs-archive-toggle.open .archive-icon,
.jira-archive-toggle.open .archive-icon,
.fs-archive-toggle-style.open .archive-icon {
	transform: rotate(180deg);
}

.fs-archive-toggle.open .archive-icon,
.jira-archive-toggle.open .archive-icon {
	transform: rotate(180deg);
}

.fs-archive-count,
.jira-archive-count {
	margin-left: auto;
	background: #e4e7ed;
	color: #606266;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
}

.fs-archive-content,
.jira-archive-content {
	display: none;
	margin-top: 15px;
}

/* Tickets Panel */
.fs-tickets-panel {
	min-height: 100px;
}

/* ============================================
   TICKETS TABLE - FLUENTSUPPORT STYLE
   ============================================ */

.fs-tickets-table,
.jira-tickets-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.fs-tickets-table thead th,
.jira-tickets-table thead th {
	background: #f5f7fa;
	padding: 12px 16px;
	text-align: left;
	font-weight: 600;
	color: #606266;
	border-bottom: 2px solid #e4e7ed;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.fs-tickets-table tbody tr,
.jira-tickets-table tbody tr {
	border-bottom: 1px solid #ebeef5;
	transition: background-color 0.15s;
}

.fs-tickets-table tbody tr:hover,
.jira-tickets-table tbody tr:hover {
	background-color: #f5f7fa;
}

.fs-tickets-table tbody td,
.jira-tickets-table tbody td {
	padding: 14px 16px;
	vertical-align: middle;
}

/* Ticket ID Column */
.fs-ticket-id,
.jira-ticket-key {
	font-weight: 600;
	color: #6366f1;
}

/* Status Badge */
.fs-status-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.fs-status-badge.status-new {
	background: #dbeafe;
	color: #1d4ed8;
}

.fs-status-badge.status-open {
	background: #fef3c7;
	color: #d97706;
}

.fs-status-badge.status-pending {
	background: #fce7f3;
	color: #be185d;
}

.fs-status-badge.status-closed,
.fs-status-badge.status-resolved {
	background: #d1fae5;
	color: #059669;
}

/* Priority Badge */
.fs-priority-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
}

.fs-priority-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.fs-priority-dot.priority-critical { background: #dc2626; }
.fs-priority-dot.priority-high { background: #f97316; }
.fs-priority-dot.priority-medium { background: #eab308; }
.fs-priority-dot.priority-normal,
.fs-priority-dot.priority-low { background: #22c55e; }

/* Contact Column */
.fs-contact-info {
	display: flex;
	align-items: center;
	gap: 8px;
}

.fs-contact-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 600;
}

.fs-contact-name {
	font-size: 13px;
	color: #1e1e1e;
}

/* Date Column */
.fs-date {
	color: #909399;
	font-size: 12px;
}

/* Pagination & Load More */
.fs-pagination-info {
	text-align: center;
	padding: 12px;
	color: #909399;
	font-size: 13px;
}

.fs-load-more-btn {
	display: block;
	width: 100%;
	padding: 12px;
	margin-top: 15px;
	background: #f5f7fa;
	border: 1px solid #e4e7ed;
	border-radius: 6px;
	color: #606266;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
}

.fs-load-more-btn:hover {
	background: #ebeef5;
	border-color: #6366f1;
	color: #6366f1;
}

/* ============================================
   MODE TOGGLE - E-Mail / Org-ID
   ============================================ */

.jira-mode-wrapper {
	background: #f8fafc;
	border-radius: 8px;
	padding: 12px;
	border: 1px solid #e4e7ed;
}

.jira-mode-toggle {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	padding: 8px 14px !important;
	border-radius: 6px !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	background: #fff !important;
	border: 1px solid #e4e7ed !important;
	cursor: pointer;
	transition: all 0.2s;
}

.jira-mode-toggle:hover {
	background: #f5f7fa !important;
	border-color: #6366f1 !important;
	color: #6366f1 !important;
}

.jira-mode-icon {
	font-size: 16px;
}

.jira-org-input-wrapper {
	background: #e7f3ff;
	border-radius: 4px;
	padding: 4px 8px;
}

.jira-org-input {
	flex: 1;
	min-width: 150px;
}

.jira-org-load-btn {
	flex-shrink: 0;
}

.jira-email-info {
	display: flex;
	align-items: center;
}

/* ============================================
   LEGACY SUPPORT
   ============================================ */

.fluent-jira-tickets-section {
	margin-top: 30px;
	padding-top: 30px;
	border-top: 2px solid #ddd;
}

.fluent-jira-tickets-section h3 {
	margin-bottom: 20px;
}

.jira-tickets-container table,
.fs-tickets-container table {
	margin-top: 0;
}

.jira-tickets-container table th,
.jira-tickets-container table td,
.fs-tickets-container table th,
.fs-tickets-container table td {
	padding: 10px;
}

/* Klickbare Ticket-Zeilen */
.jira-ticket-row {
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.jira-ticket-row:hover {
	background-color: rgba(0, 115, 170, 0.08) !important;
}

.jira-ticket-key {
	color: #0073aa;
	font-weight: 600;
	text-decoration: none;
}

.jira-ticket-key:hover {
	text-decoration: underline;
}

/* ============================================
   JIRA TICKET DETAIL MODAL
   ============================================ */

.jira-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.6);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	backdrop-filter: blur(2px);
}

.jira-modal-overlay.active {
	opacity: 1;
	visibility: visible;
}

.jira-modal {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	width: 90%;
	max-width: 800px;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	transform: scale(0.9) translateY(20px);
	transition: transform 0.25s ease;
	overflow: hidden;
}

.jira-modal-overlay.active .jira-modal {
	transform: scale(1) translateY(0);
}

/* Modal Header */
.jira-modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid #e5e5e5;
	background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.jira-modal-header-content {
	flex: 1;
	min-width: 0;
}

.jira-modal-key {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #0052cc;
	background: #deebff;
	padding: 4px 10px;
	border-radius: 4px;
	margin-bottom: 8px;
}

.jira-modal-key img {
	width: 16px;
	height: 16px;
}

.jira-modal-title {
	font-size: 20px;
	font-weight: 600;
	color: #172b4d;
	margin: 0;
	line-height: 1.4;
	word-wrap: break-word;
}

.jira-modal-close {
	background: none;
	border: none;
	font-size: 28px;
	color: #6b778c;
	cursor: pointer;
	padding: 0;
	margin-left: 16px;
	line-height: 1;
	transition: color 0.15s ease, transform 0.15s ease;
	flex-shrink: 0;
}

.jira-modal-close:hover {
	color: #172b4d;
	transform: scale(1.1);
}

/* Modal Body */
.jira-modal-body {
	flex: 1;
	overflow-y: auto;
	padding: 24px;
}

/* Meta Grid */
.jira-modal-meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
	margin-bottom: 24px;
	padding: 16px;
	background: #f4f5f7;
	border-radius: 8px;
}

.jira-modal-meta-item {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.jira-modal-meta-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #6b778c;
}

.jira-modal-meta-value {
	font-size: 14px;
	color: #172b4d;
	display: flex;
	align-items: center;
	gap: 8px;
}

.jira-modal-meta-value img {
	width: 24px;
	height: 24px;
	border-radius: 50%;
}

/* Status Badge */
.jira-modal-status {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
}

.jira-modal-status.status-blue,
.jira-modal-status.status-blue-gray {
	background: #deebff;
	color: #0052cc;
}

.jira-modal-status.status-green {
	background: #e3fcef;
	color: #006644;
}

.jira-modal-status.status-yellow {
	background: #fff3cd;
	color: #856404;
}

/* Priority Badge */
.jira-modal-priority {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.jira-modal-priority img {
	width: 16px;
	height: 16px;
}

/* Sections */
.jira-modal-section {
	margin-bottom: 24px;
}

.jira-modal-section:last-child {
	margin-bottom: 0;
}

.jira-modal-section-title {
	font-size: 14px;
	font-weight: 600;
	color: #172b4d;
	margin: 0 0 12px 0;
	padding-bottom: 8px;
	border-bottom: 2px solid #0052cc;
	display: inline-block;
}

.jira-modal-description {
	font-size: 14px;
	line-height: 1.6;
	color: #42526e;
}

.jira-modal-description p {
	margin: 0 0 12px 0;
}

.jira-modal-description p:last-child {
	margin-bottom: 0;
}

.jira-modal-description ul,
.jira-modal-description ol {
	margin: 0 0 12px 0;
	padding-left: 24px;
}

.jira-modal-description code {
	background: #f4f5f7;
	padding: 2px 6px;
	border-radius: 3px;
	font-family: monospace;
	font-size: 13px;
}

.jira-modal-description pre {
	background: #f4f5f7;
	padding: 12px;
	border-radius: 6px;
	overflow-x: auto;
	margin: 12px 0;
}

.jira-modal-description blockquote {
	border-left: 3px solid #0052cc;
	margin: 12px 0;
	padding: 8px 16px;
	background: #f8f9fa;
	color: #42526e;
}

.jira-modal-description .mention {
	color: #0052cc;
	background: #deebff;
	padding: 1px 4px;
	border-radius: 3px;
}

.jira-modal-empty {
	color: #6b778c;
	font-style: italic;
}

/* Comments */
.jira-modal-comments {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.jira-modal-comment {
	background: #f8f9fa;
	border-radius: 8px;
	padding: 16px;
	border-left: 3px solid #0052cc;
}

.jira-modal-comment-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}

.jira-modal-comment-author {
	font-weight: 600;
	color: #172b4d;
	font-size: 14px;
}

.jira-modal-comment-date {
	font-size: 12px;
	color: #6b778c;
}

.jira-modal-comment-body {
	font-size: 14px;
	line-height: 1.5;
	color: #42526e;
}

/* Attachments */
.jira-modal-attachments {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.jira-modal-attachment {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	background: #f4f5f7;
	border-radius: 6px;
	text-decoration: none;
	color: #172b4d;
	transition: background-color 0.15s ease;
	font-size: 13px;
}

.jira-modal-attachment:hover {
	background: #ebecf0;
}

.jira-modal-attachment-icon {
	font-size: 18px;
}

.jira-modal-attachment-size {
	color: #6b778c;
	font-size: 11px;
}

/* Modal Footer */
.jira-modal-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	padding: 16px 24px;
	border-top: 1px solid #e5e5e5;
	background: #f8f9fa;
}

.jira-modal-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.15s ease;
	border: none;
}

.jira-modal-btn-primary {
	background: #0052cc;
	color: #fff;
}

.jira-modal-btn-primary:hover {
	background: #0747a6;
	color: #fff;
}

.jira-modal-btn-secondary {
	background: #fff;
	color: #42526e;
	border: 1px solid #dfe1e6;
}

.jira-modal-btn-secondary:hover {
	background: #f4f5f7;
}

/* Loading State */
.jira-modal-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 60px 20px;
	color: #6b778c;
}

.jira-modal-loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #f4f5f7;
	border-top-color: #0052cc;
	border-radius: 50%;
	animation: jira-spin 0.8s linear infinite;
	margin-bottom: 16px;
}

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

/* Error State */
.jira-modal-error {
	text-align: center;
	padding: 40px 20px;
	color: #de350b;
}

.jira-modal-error-icon {
	font-size: 48px;
	margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 768px) {
	.jira-modal {
		width: 95%;
		max-height: 90vh;
		margin: 20px;
	}
	
	.jira-modal-header {
		padding: 16px;
	}
	
	.jira-modal-title {
		font-size: 18px;
	}
	
	.jira-modal-body {
		padding: 16px;
	}
	
	.jira-modal-meta {
		grid-template-columns: repeat(2, 1fr);
	}
	
	.jira-modal-footer {
		padding: 12px 16px;
		flex-wrap: wrap;
	}
}

