* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --suite-bg-start: #2c3e50;
    --suite-bg-end: #3498db;
    --suite-accent: #3498db;
    --suite-accent-dark: #2c3e50;
    --suite-accent-hover: #2980b9;
    --bg-primary: #f5f7fa;
    --bg-card: rgba(255, 255, 255, 0.95);
    --text-primary: #2c3e50;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --accent: #3498db;
    --accent-hover: #2980b9;
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.12);
    --card-radius: 20px;
    --success-border: #3498db;
    --success-bg: #eef6fc;
    --success-text: #4a6278;
}

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

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, var(--suite-bg-start) 0%, var(--suite-bg-end) 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

header,
.page-header {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 2rem;
    padding: 2rem 2.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-toolbar {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    padding: 1rem 1.25rem 0;
    margin: 0;
    box-sizing: border-box;
}

.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: #fff;
    color: #2c3e50;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.2;
}

.back-home-btn:hover {
    color: var(--suite-accent);
    text-decoration: none;
}

header h1,
.page-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.page-header p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.page-header .accuracy-note {
    display: block;
    margin: 1rem auto 0;
    max-width: 52rem;
    padding: 0.75rem 1rem;
    background: #fff8e8;
    color: #6b4f12;
    border: 1px solid #f0d9a0;
    border-left: 4px solid #e0a106;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--card-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 50%, #95a5a6 100%);
    opacity: 0.55;
}

.card h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.config-card {
    min-height: fit-content;
}

.actions-card {
    min-height: fit-content;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: white;
    color: var(--text-primary);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
    max-width: 100%;
    margin: 0;
}

.action-btn {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    min-height: 160px;
    min-width: 0;
    width: 100%;
    justify-content: center;
}

.action-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.action-desc {
    font-size: 0.85rem;
    opacity: 0.8;
    line-height: 1.35;
    max-width: 16rem;
}

.action-btn:hover:not(:disabled) {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.action-icon svg {
    width: 28px;
    height: 28px;
    color: var(--suite-accent);
    flex-shrink: 0;
}

.action-btn-primary .action-icon svg {
    color: #ffffff;
}

.action-btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.action-btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-decoration: none;
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: white;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--text-primary);
}

.browse-btn {
    padding: 0.65rem 1rem;
    border: 2px solid #3498db;
    background: white;
    color: #3498db;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.browse-btn:hover {
    background: #3498db;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.browse-btn:active {
    transform: translateY(0);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--text-primary);
    color: white;
    transform: translateY(-2px);
}

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

/* Download files section */
.file-download-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-download-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.file-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-family: monospace;
}

.download-btn {
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.loading-section {
    text-align: center;
}

.loading-content h3 {
    margin: 1rem 0 0.75rem;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.spinner {
    border: 3px solid #e0e0e0;
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    width: 0%;
    transition: width 0.3s;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.downloads-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

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

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.download-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-card);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    font-weight: 500;
    font-size: 0.9rem;
    min-height: 56px;
}

.download-link:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(52, 152, 219, 0.3);
}

.download-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.summary {
    background: rgba(44, 62, 80, 0.05);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid rgba(44, 62, 80, 0.15);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(44, 62, 80, 0.08);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item strong {
    color: var(--text-primary);
    font-weight: 700;
}

.summary-item-highlight {
    background: rgba(52, 152, 219, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin: 0.75rem 0;
    border: 2px solid rgba(52, 152, 219, 0.2);
}

.summary-item-highlight:first-child {
    margin-top: 0;
}

.coverage-high {
    color: #27ae60 !important;
}

.coverage-medium {
    color: #f39c12 !important;
}

.coverage-low {
    color: #e74c3c !important;
}

.coverage-detail {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-left: 0.5rem;
    font-weight: 400;
}

.error-section {
    background: var(--bg-card);
    border: 2px solid #e74c3c;
}

.error-section h2 {
    color: #e74c3c;
}

#error-message {
    background: rgba(231, 76, 60, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    color: #666;
    font-size: 0.9rem;
}

.back-home-arrow {
    font-size: 0.88em;
    line-height: 1;
    opacity: 0.95;
}

.form-action-btn {
    padding: 0.7rem 1rem;
    border: 2px solid var(--suite-accent);
    border-radius: 6px;
    background: white;
    color: var(--suite-accent);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex: 1;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.form-action-btn:hover {
    background: var(--suite-accent);
    color: white;
}

.form-action-btn--purple {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.form-action-btn--purple:hover {
    background: #8b5cf6;
    color: white;
}

.results-group--quality {
    border-left-color: #2563eb;
}

.form-action-btn svg,
.inline-icon svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.form-row-actions {
    display: flex;
    gap: 0.5rem;
}

.form-input-lg {
    width: 100%;
    padding: 0.7rem;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.form-label-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.section-heading-center {
    text-align: center;
    margin-bottom: 1.5rem;
}

.section-spaced {
    margin-bottom: 2rem;
}

.sticky-actions {
    position: sticky;
    top: 20px;
    z-index: 100;
}

.callout-info {
    font-size: 0.92rem;
    color: var(--success-text);
    background: var(--success-bg);
    border-left: 4px solid var(--success-border);
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 1rem;
    line-height: 1.5;
}

.callout-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.callout-warning-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.callout-warning-icon svg {
    width: 24px;
    height: 24px;
    color: #92400e;
}

.callout-warning strong {
    color: #92400e;
    display: block;
    margin-bottom: 0.25rem;
}

.callout-warning span {
    color: #78350f;
    font-size: 0.9rem;
}

.callout-warning code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

.callout-dismiss {
    background: none;
    border: none;
    color: #92400e;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.callout-dismiss:hover {
    background: rgba(0, 0, 0, 0.1);
}

.help-panel {
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.help-panel-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: #24292f;
}

.help-panel-content {
    display: none;
    padding: 0 1rem 1rem 1rem;
    border-top: 1px solid #d0d7de;
}

.help-panel-body {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #57606a;
    line-height: 1.6;
}

.action-btn-clean {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-color: transparent;
}

.action-btn-clean .action-icon svg {
    color: white;
}

.file-type-icon svg {
    width: 22px;
    height: 22px;
    color: var(--suite-accent);
    flex-shrink: 0;
}

button:focus-visible,
.form-action-btn:focus-visible,
.action-btn:focus-visible,
.browse-btn:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--suite-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .action-btn:hover:not(:disabled),
    .form-action-btn:hover,
    .repo-item:hover {
        transform: none;
    }
}

@media (max-width: 1100px) {
    .actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header,
    .page-header {
        padding: 1.5rem 1.25rem;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 1.5rem;
    }
}

.field-error {
    display: block;
    margin-top: 0.35rem;
    color: #c0392b;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
}

.field-error[hidden] {
    display: none;
}

#config-form input[aria-invalid="true"] {
    border-color: #c0392b;
    background: #fdf2f2;
}

.config-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.config-header-row h2 {
    margin: 0;
}

.config-header-row .form-action-btn {
    flex: 0 0 auto;
}

.gitlab-fill-target {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
}

.gitlab-fill-target[hidden] {
    display: none;
}

.gitlab-fill-target > span {
    font-weight: 600;
    color: var(--text-primary);
}

.gitlab-fill-target label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
    cursor: pointer;
}
