/* ========================================
   Intel Test Analysis Dashboard - Styles
   ======================================== */

/* CSS Variables - Theme System */
:root {
    --primary: #0071C5;
    --primary-light: #0096D6;
    --primary-dark: #005A9E;

    /* Light Theme (Default) */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecef;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a68;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);

    /* Status Colors */
    --failed: #dc3545;
    --failed-bg: rgba(220, 53, 69, 0.15);
    --errored: #fd7e14;
    --errored-bg: rgba(253, 126, 20, 0.15);
    --skipped: #17a2b8;
    --skipped-bg: rgba(23, 162, 184, 0.15);
    --aborted: #6c757d;
    --aborted-bg: rgba(108, 117, 125, 0.15);
    --passed: #28a745;
    --passed-bg: rgba(40, 167, 69, 0.15);

    /* Spacing */
    --sidebar-width: 280px;
    --header-height: 60px;
    --radius: 12px;
    --radius-sm: 8px;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #f0f6fc;
    --text-secondary: #c9d1d9;
    --text-muted: #8b949e;
    --border-color: #30363d;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.4);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Ensure hidden attribute works */
[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========================================
   Header
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    box-shadow: 0 2px 8px var(--shadow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
}

/* Theme Toggle Icons */
[data-theme="light"] .icon-sun {
    display: none;
}

[data-theme="light"] .icon-moon {
    display: block;
}

[data-theme="dark"] .icon-sun {
    display: block;
}

[data-theme="dark"] .icon-moon {
    display: none;
}

/* ========================================
   Layout
   ======================================== */
.main-container {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-tertiary);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(0, 113, 197, 0.1);
}

.upload-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.upload-zone p {
    margin: 4px 0;
    color: var(--text-secondary);
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Upload Progress */
.upload-progress {
    margin-top: 16px;
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    width: 0%;
    transition: width 0.3s;
    animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.no-files {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    padding: 16px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.file-item:hover {
    background: rgba(0, 113, 197, 0.1);
}

.file-item.selected {
    border-color: var(--primary);
    background: rgba(0, 113, 197, 0.1);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.file-icon {
    font-size: 1.2rem;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.file-tag.failed {
    background: var(--failed-bg);
    color: var(--failed);
}

.file-tag.errored {
    background: var(--errored-bg);
    color: var(--errored);
}

/* ========================================
   Main Content
   ======================================== */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    background: var(--bg-primary);
}

/* ========================================
   Tabs
   ======================================== */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tab.active {
    background: var(--primary);
    color: white;
}

/* Tab Panels */
.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

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

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

.panel-header {
    margin-bottom: 24px;
}

.panel-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.panel-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.btn-clear-chat {
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-clear-chat::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-clear-chat:hover {
    background: var(--primary-dark);
}

.btn-clear-chat:active {
    box-shadow: 0 2px 10px rgba(0, 113, 197, 0.3);
}

.file-context,
.chat-context {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ========================================
   Status Summary Cards
   ======================================== */
.status-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.status-card {
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--bg-secondary);
    box-shadow: 0 2px 8px var(--shadow);
}

.status-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-lg);
}

.status-card.status-failed {
    border-left: 4px solid var(--failed);
}

.status-card.status-errored {
    border-left: 4px solid var(--errored);
}

.status-card.status-skipped {
    border-left: 4px solid var(--skipped);
}

.status-card.status-aborted {
    border-left: 4px solid var(--aborted);
}

.status-count {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
}

.status-card.status-failed .status-count {
    color: var(--failed);
}

.status-card.status-errored .status-count {
    color: var(--errored);
}

.status-card.status-skipped .status-count {
    color: var(--skipped);
}

.status-card.status-aborted .status-count {
    color: var(--aborted);
}

.status-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   Test Results
   ======================================== */
.test-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status-group {
    margin-bottom: 24px;
}

.status-group-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 1rem;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* Test Card */
.test-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: box-shadow 0.2s;
    margin-bottom: 16px;
}

.test-card:hover {
    box-shadow: 0 4px 16px var(--shadow);
}

.test-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    cursor: pointer;
}

.test-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.test-card-title h4 {
    font-size: 1rem;
    font-weight: 600;
}

.test-card-body {
    padding: 20px;
    display: none;
}

.test-card.expanded .test-card-body {
    display: block;
}

.test-card-toggle {
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.test-card.expanded .test-card-toggle {
    transform: rotate(180deg);
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-failed {
    background: var(--failed-bg);
    color: var(--failed);
}

.badge-errored {
    background: var(--errored-bg);
    color: var(--errored);
}

.badge-skipped {
    background: var(--skipped-bg);
    color: var(--skipped);
}

.badge-aborted {
    background: var(--aborted-bg);
    color: var(--aborted);
}

.badge-passed {
    background: var(--passed-bg);
    color: var(--passed);
}

/* Analysis Section */
.analysis-section {
    margin-top: 16px;
    padding: 16px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--border-color);
    background: var(--bg-tertiary);
}

.analysis-section h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.analysis-section.root-cause {
    border-left-color: var(--errored);
}

.analysis-section.error {
    border-left-color: var(--failed);
}

.analysis-section.fix {
    border-left-color: var(--passed);
}

.text-muted {
    color: var(--text-muted);
}

/* Historical Match Alert */
.historical-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.08));
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.08));
    }

    50% {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.12));
    }
}

.historical-icon {
    font-size: 1.1rem;
}

.historical-text {
    font-size: 0.85rem;
    color: #d97706;
}

[data-theme="dark"] .historical-text {
    color: #fbbf24;
}

.historical-text strong {
    font-weight: 600;
}

.historical-expand-hint {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 8px;
}

.historical-alert {
    cursor: pointer;
    transition: background 0.2s;
}

.historical-alert:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(245, 158, 11, 0.15));
}

.historical-alert.expanded {
    border-bottom: none;
}

/* Side-by-side comparison panel */
.historical-comparison {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}

.comparison-panel {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.comparison-panel h5 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.comparison-panel.current-error {
    border-left: 3px solid var(--primary);
}

.comparison-panel.historical-error {
    border-left: 3px solid #f59e0b;
}

.error-content {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Consolas', 'Monaco', monospace;
    background: var(--bg-tertiary);
    padding: 8px;
    border-radius: 4px;
}

/* ========================================
   Charts
   ======================================== */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.chart-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow);
}

.chart-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* ========================================
   Chat
   ======================================== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 280px);
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.chat-welcome {
    text-align: center;
    padding: 40px 20px;
}

.welcome-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
}

.chat-welcome h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.chat-welcome p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.suggested-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.suggested-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.suggested-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 113, 197, 0.1);
}

/* Chat Messages */
.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--primary);
    color: white;
}

.message.assistant .message-avatar {
    background: var(--bg-tertiary);
}

.message-content {
    flex: 1;
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    max-width: 80%;
}

.message.user .message-content {
    background: var(--primary);
    color: white;
    margin-left: auto;
}

.typing-dots span {
    animation: blink 1.4s infinite both;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {

    0%,
    80%,
    100% {
        opacity: 0;
    }

    40% {
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: var(--primary);
}

.btn-send {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-send:hover {
    background: var(--primary-dark);
}

.btn-send:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ========================================
   Help
   ======================================== */
.help-content {
    display: grid;
    gap: 24px;
}

.help-section {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow);
}

.help-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.help-section ol,
.help-section ul {
    padding-left: 24px;
    color: var(--text-secondary);
}

.help-section li {
    margin-bottom: 8px;
}

.status-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ========================================
   Loading Overlay
   ======================================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    margin-top: 16px;
    color: white;
    font-size: 1rem;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.toast {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideUp 0.3s ease;
    max-width: 400px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.toast.success {
    border-left: 4px solid var(--passed);
}

.toast.error {
    border-left: 4px solid var(--failed);
}

.toast.warning {
    border-left: 4px solid var(--errored);
}

.toast.info {
    border-left: 4px solid var(--primary);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
    }

    .content {
        margin-left: 0;
    }

    .main-container {
        flex-direction: column;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Jira Integration
   ======================================== */
.test-card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-jira {
    padding: 6px 12px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #0052CC, #0065FF);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-jira:hover {
    background: linear-gradient(135deg, #0065FF, #0077FF);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.4);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.jira-modal {
    border-top: 4px solid #0052CC;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-close:hover {
    background: var(--failed);
    color: white;
}

.modal-body {
    padding: 20px;
}

.jira-actions {
    margin: 16px 0;
}

.btn-primary {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--passed);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-top: 16px;
}

.btn-success:hover {
    opacity: 0.9;
}

.btn-success:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.jira-results {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin: 16px 0;
    min-height: 80px;
}

.jira-results:empty {
    display: none;
}

.jira-ticket-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
}

.jira-ticket-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}

.jira-ticket-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    flex: 1;
}

.jira-ticket-link:hover {
    color: var(--primary);
}

.jira-key {
    background: #0052CC;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.jira-summary {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jira-status {
    font-size: 0.7rem;
}

.jira-success {
    text-align: center;
    padding: 20px;
}

.jira-new {
    display: inline-block;
    margin-top: 12px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0052CC, #0065FF);
    color: white;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.jira-new:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 82, 204, 0.4);
}

/* Ticket Detail View */
.ticket-detail {
    padding: 8px;
}

.ticket-detail .ticket-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ticket-detail h4 {
    margin: 8px 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.ticket-section {
    margin: 12px 0;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.ticket-section strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.ticket-section p {
    margin: 0;
    line-height: 1.5;
}

.ticket-section .log-snippet {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}