/* Modern Test Automation Platform - Sidebar and Test List Styles */

/* Боковая панель */
.sidebar {
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease;
}

body.dark .sidebar {
    background: var(--gray-800);
    border-color: var(--border-dark);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    height: 70px;
    box-sizing: border-box;
}

body.dark .sidebar-header {
    border-color: var(--border-dark);
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-controls {
    display: flex;
    gap: 0.5rem;
}

.compact-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

body.dark .compact-btn {
    background: var(--gray-700);
    color: var(--gray-300);
}

.compact-btn:hover {
    background: var(--gray-200);
    color: var(--gray-800);
    transform: translateY(-1px);
}

body.dark .compact-btn:hover {
    background: var(--gray-600);
    color: white;
}

.sidebar-search {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

body.dark .sidebar-search {
    border-color: var(--border-dark);
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 38px; /* Фиксированная высота для контейнера */
}

.search-icon-wrapper {
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    margin: auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: var(--gray-400);
    z-index: 5;
    pointer-events: none;
    line-height: 1;
}

.search-icon-wrapper i {
    font-size: 14px;
    line-height: 1;
}

.search-input {
    width: 100%;
    height: 100%;
    padding: 0 38px 0 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-light);
    font-size: 0.85rem;
    transition: var(--transition);
}

body.dark .search-input {
    background: var(--gray-700);
    border-color: var(--border-dark);
    color: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 0;
    bottom: 0;
    margin: auto 0;
    background: transparent;
    border: none;
    color: var(--gray-400);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: var(--transition);
}

.clear-search-btn i {
    font-size: 10px;
    line-height: 1;
}

.clear-search-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

body.dark .clear-search-btn:hover {
    background: var(--gray-600);
    color: white;
}

/* Улучшенные стили для элементов тестов */
.test-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

body.dark .test-item {
    border-color: var(--border-dark);
}

.test-item:hover {
    background: rgba(128, 90, 213, 0.05);
}

.test-item.active {
    background: rgba(128, 90, 213, 0.1);
    border-left: 3px solid var(--accent);
}

body.dark .test-item:hover {
    background: rgba(128, 90, 213, 0.1);
}

body.dark .test-item.active {
    background: rgba(128, 90, 213, 0.15);
}

.test-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

.test-item.success .test-icon {
    color: var(--success);
}

.test-item.failed .test-icon {
    color: var(--danger);
}

.test-item.warning .test-icon {
    color: var(--warning);
}

.test-info {
    flex: 1;
    min-width: 0;
}

.test-name {
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.test-meta {
    font-size: 0.75rem;
    color: var(--text-light);
}

body.dark .test-meta {
    color: var(--text-light);
}

.status-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.success {
    background: rgba(56, 161, 105, 0.15);
    color: var(--success);
}

.status-badge.failed {
    background: rgba(229, 62, 62, 0.15);
    color: var(--danger);
}

.status-badge.warning {
    background: rgba(236, 201, 75, 0.15);
    color: var(--warning);
}

body.dark .status-badge.success {
    background: rgba(56, 161, 105, 0.25);
}

body.dark .status-badge.failed {
    background: rgba(229, 62, 62, 0.25);
}

body.dark .status-badge.warning {
    background: rgba(236, 201, 75, 0.25);
}

/* Стили для кнопок действий с тестами */
.test-actions {
    display: flex;
    gap: 4px;
    margin-right: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.test-item:hover .test-actions {
    opacity: 1;
}

.test-action-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 4px;
    border: 1px solid rgba(128, 90, 213, 0.15);
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    font-size: 0.7rem;
    padding: 0;
    transition: all 0.2s ease;
    backdrop-filter: blur(2px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.test-action-btn:hover {
    background-color: white;
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.test-action-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.test-action-btn.restart-test:hover {
    color: var(--primary);
    border-color: rgba(49, 130, 206, 0.3);
}

.test-action-btn.view-details:hover {
    color: var(--accent);
    border-color: rgba(128, 90, 213, 0.3);
}

.test-action-btn.delete-test:hover {
    color: var(--danger);
    border-color: rgba(229, 62, 62, 0.3);
}

body.dark .test-action-btn {
    background: rgba(45, 55, 72, 0.6);
    border-color: rgba(128, 90, 213, 0.2);
    color: var(--text-dark);
}

body.dark .test-action-btn:hover {
    background: rgba(45, 55, 72, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Красивые эффекты для кнопок действий */
.test-action-btn:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    opacity: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    transition: opacity 0.3s ease;
}

.test-action-btn:active:after {
    opacity: 0.6;
    transition: 0s;
}

body.dark .test-action-btn:after {
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
}

/* Анимация кнопки перезапуска при клике */
.test-action-btn.restart-test.spinning i {
    animation: spin 1s linear infinite;
}

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