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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

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

.controls {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #229954;
}

.btn-warning {
    background: #f39c12;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.status {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-failure {
    background: #f8d7da;
    color: #721c24;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

/* Status dots */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-dot-success {
    background-color: #28ee45;
}

.status-dot-failure {
    background-color: #ee3545;
}

.status-dot-error {
    background-color: #ee3545;
}

.status-dot-pending {
    background-color: #ffc107;
}

.attention-icon {
    font-size: 0.9rem;
    margin-right: 0.25rem;
    color: #ff9800;
}

.tests-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.subproject-group {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.subproject-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subproject-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.test-count {
    font-size: 0.9rem;
    color: #6c757d;
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.subproject-tests {
    padding: 0.5rem 0;
}

.test-row {
    display: flex;
    align-items: center;
    padding: 0;
    padding-left: 1rem;
    padding-right: 1rem;
    height: 20px;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s;
}

.test-row:last-child {
    border-bottom: none;
}

.test-row:hover {
    background-color: #f8f9fa;
}

.test-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.test-name {
    font-size: 0.85rem;
    font-weight: 400;
    color: #2c3e50;
}

.test-meta {
    flex: 0 0 auto;
    margin-right: 0.75rem;
}

.last-run {
    font-size: 0.75rem;
    color: #6c757d;
}

.test-actions {
    display: flex;
    gap: 0.25rem;
    flex: 0 0 auto;
}

.btn-icon {
    background: transparent;
    border: none;
    color: #495057;
    padding: 0;
    cursor: pointer;
    font-size: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    opacity: 0.7;
}

.btn-icon:hover:not(:disabled) {
    opacity: 1;
    transform: scale(1.2);
}

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


.loading {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}

.last-run {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 0.5rem;
}

.refresh-btn {
    margin-left: auto;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    height: 90vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.modal-header {
    background: #2c3e50;
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.history-navigation {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.history-position {
    font-size: 0.9rem;
    color: #ecf0f1;
    min-width: 3rem;
    text-align: center;
}

.btn-nav {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

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

.btn-delete {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.5);
    margin-left: 0.5rem;
}

.btn-delete:hover:not(:disabled) {
    background: rgba(220, 53, 69, 0.5);
    border-color: rgba(220, 53, 69, 0.7);
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.2s;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 1.5rem;
    height: calc(90vh - 80px);
    overflow-y: auto;
}

.result-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.result-status {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.result-status.success {
    background: #d4edda;
    color: #155724;
}

.result-status.failure {
    background: #f8d7da;
    color: #721c24;
}

.result-status.error {
    background: #f8d7da;
    color: #721c24;
}

.result-status-text {
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.result-timestamp {
    font-size: 0.8rem;
    color: #6c757d;
}

.result-duration {
    font-size: 0.8rem;
    color: #6c757d;
    margin-left: 1rem;
}

.result-message {
    margin: 0.5rem 0;
    font-weight: 500;
}

.result-output {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 0.75rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre-wrap;
    height: calc(90vh - 200px);
    overflow-y: auto;
    margin-top: 0.5rem;
}

.result-error {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.no-results {
    text-align: center;
    color: #6c757d;
    padding: 2rem;
    font-style: italic;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

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

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

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .tests-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-body {
        padding: 1rem;
    }
}