/* Test Dashboard page styles */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --dark-color: #212529;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    border: none;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.header-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header-card h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.navbar-custom {
    background: white;
    border-radius: 15px;
    padding: 15px 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.navbar-custom .nav-link {
    color: #495057;
    font-weight: 600;
    padding: 8px 15px;
    margin: 0 5px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.navbar-custom .nav-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.navbar-custom .nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-outline-light {
    border-radius: 25px;
    font-weight: 600;
    border: 2px solid #667eea;
    color: #667eea;
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    transform: scale(1.05);
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.stats-card {
    background: white;
    padding: 20px;
}

.stat-box {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    margin: 10px;
    transition: all 0.3s ease;
}

.stat-box:hover {
    transform: scale(1.05);
}

.stat-box.success {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-box.danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.stat-box.warning {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    color: white;
}

.stat-box h3 {
    font-size: 2.5rem;
    margin: 0;
    font-weight: bold;
}

.stat-box p {
    margin: 5px 0 0 0;
    font-size: 1rem;
    opacity: 0.9;
}

.module-card {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    border-left: 5px solid var(--primary-color);
    transition: all 0.3s ease;
}

.module-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.module-card.tested {
    border-left-color: var(--success-color);
}

.module-card.failed {
    border-left-color: var(--danger-color);
}

.module-card h5 {
    margin: 0;
    font-weight: 600;
}

.module-tests-list {
    border-top: 1px solid #e9ecef;
    padding-top: 10px;
}

.test-item {
    padding: 8px 12px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid var(--primary-color);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.test-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.test-item-name {
    font-weight: 600;
    color: #495057;
}

.test-item-desc {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 3px;
}

.module-expand-icon {
    color: #6c757d;
    font-size: 0.85rem;
}

.module-expand-icon.expanded {
    transform: rotate(90deg);
}

.coverage-bar {
    height: 25px;
    border-radius: 15px;
    background: #e9ecef;
    overflow: hidden;
    margin: 10px 0;
}

.coverage-fill {
    height: 100%;
    background: #198754;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
    transition: width 1s ease;
}

.coverage-fill[style*="width: 0"] {
    background: #dc3545;
}

.coverage-fill[data-coverage-low] {
    background: #dc3545;
}

.coverage-fill[data-coverage-medium] {
    background: #ffc107;
    color: #212529;
}

.coverage-fill[data-coverage-high] {
    background: #198754;
}

.btn-test {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-test:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.test-output {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.badge-custom {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
}

.status-indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
}

.status-indicator.running {
    background: var(--warning-color);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-indicator.success {
    background: var(--success-color);
}

.status-indicator.failed {
    background: var(--danger-color);
}

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

/* Trends and Analytics Styles */
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.stat-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.95rem;
}

.stat-value {
    font-weight: bold;
    color: #212529;
    font-size: 1.1rem;
}

.stat-value .fa-arrow-up {
    color: var(--success-color);
}

.stat-value .fa-arrow-down {
    color: var(--danger-color);
}

.stat-value .fa-minus {
    color: var(--warning-color);
}

#coverageTrendChart {
    max-height: 300px;
}

/* Test Categories Styles */
.category-card {
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.category-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.category-unit {
    border-left-color: var(--success-color);
}

.category-integration {
    border-left-color: #0dcaf0;
}

.category-e2e {
    border-left-color: var(--warning-color);
}

.category-modules {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
}

.category-module-item {
    padding: 6px 10px;
    margin: 4px 0;
    background: white;
    border-radius: 5px;
    font-size: 0.85rem;
    color: #495057;
    transition: all 0.2s ease;
}

.category-module-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding-left: 15px;
}

.category-module-item:hover .text-primary,
.category-module-item:hover .category-module-icon {
    color: white !important;
}

.category-module-item:hover .badge {
    opacity: 0.9;
}

.category-module-item i {
    margin-right: 5px;
}

/* Module tests hierarchy styles */
.module-tests-hierarchy {
    padding: 8px;
    background: #fafafa;
    border-radius: 6px;
    max-height: 400px;
    overflow-y: auto;
}

.module-test-file {
    margin-bottom: 6px;
}

.module-test-file-header:hover {
    background: #e9ecef !important;
}

.module-test-file-content {
    border-left: 2px solid #dee2e6;
    padding-left: 12px;
}

.module-test-class {
    background: #fff;
    border-radius: 4px;
    padding: 4px 8px;
}

.module-test-functions {
    border-left: 2px solid #e8e8e8;
}

.text-purple {
    color: #8b5cf6 !important;
}

.font-monospace {
    font-family: 'Courier New', Consolas, monospace;
}

#categories-container .badge {
    font-size: 1.2rem;
    padding: 8px 12px;
    min-width: 45px;
}

/* Tests Tree Styles */
.tests-tree {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
}

.tree-node {
    margin: 2px 0;
}

.tree-node-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
}

.tree-node-header:hover {
    background: #f8f9fa;
}

.tree-toggle:hover {
    background: #e9ecef;
}

.tree-arrow {
    width: 16px;
    font-size: 0.75rem;
    color: #6c757d;
    transition: transform 0.2s ease;
}

.tree-arrow-placeholder {
    width: 16px;
    display: inline-block;
}

.tree-icon {
    width: 18px;
    text-align: center;
}

.tree-node-name {
    flex: 1;
    font-weight: 500;
    color: #212529;
}

.tree-node-count {
    font-size: 0.75rem;
    padding: 2px 8px;
}

.tree-children {
    margin-left: 24px;
    border-left: 1px solid #e9ecef;
    padding-left: 8px;
}

.tree-test-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    gap: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tree-test-item:hover {
    background: #e8f5e9;
}

.tree-test-name {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #495057;
}

/* Node type specific styles */
.type-category > .tree-node-header {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border-left: 3px solid #ffc107;
}

.type-package > .tree-node-header {
    background: #f0f7ff;
    border-left: 3px solid #0d6efd;
}

.type-module > .tree-node-header {
    background: #e8f5f5;
    border-left: 3px solid #0dcaf0;
}

.type-class > .tree-node-header {
    background: #f3e8ff;
    border-left: 3px solid #8b5cf6;
}

.text-purple {
    color: #8b5cf6;
}

/* Depth-based indentation visual cues */
.depth-0 > .tree-node-header {
    font-weight: 600;
}

.depth-1 > .tree-node-header .tree-node-name {
    font-size: 0.95rem;
}

.depth-2 > .tree-node-header .tree-node-name {
    font-size: 0.9rem;
}

.depth-3 > .tree-node-header .tree-node-name {
    font-size: 0.85rem;
}

/* Search highlight */
.tree-node.search-match > .tree-node-header {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
}

/* Responsive */
@media (max-width: 768px) {
    .tree-children {
        margin-left: 12px;
    }

    .tree-node-header {
        padding: 6px 8px;
    }

    .tree-test-name {
        font-size: 0.8rem;
    }
}
