/* TestManagier Styles - Main stylesheet for TestManagier interface */

:root {
    --tm-primary: #6366f1;
    --tm-secondary: #8b5cf6;
    --tm-success: #10b981;
    --tm-warning: #f59e0b;
    --tm-danger: #ef4444;
    --tm-info: #3b82f6;
    --tm-light: #f8fafc;
    --tm-border: #e2e8f0;
    --tm-sidebar-width: 320px;
}

.tm-fullscreen-container {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8fafc;
    z-index: 100;
    display: flex;
    overflow: hidden;
}

.tm-sidebar {
    width: var(--tm-sidebar-width);
    background: white;
    border-right: 1px solid var(--tm-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tm-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--tm-border);
    background: linear-gradient(135deg, var(--tm-primary) 0%, var(--tm-secondary) 100%);
    color: white;
    position: relative;
}

.tm-back-button {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tm-back-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.tm-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tm-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tm-toolbar {
    padding: 20px;
    background: white;
    border-bottom: 1px solid var(--tm-border);
    display: flex;
    justify-content: between;
    align-items: center;
    gap: 15px;
}

.tm-content-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Tree Styles */
.tm-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tm-tree-item {
    margin-bottom: 2px;
}

.tm-tree-node {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
}

.tm-tree-node:hover {
    background: #f1f5f9;
}

.tm-tree-node.active {
    background: var(--tm-primary);
    color: white;
}

.tm-tree-node.folder {
    font-weight: 500;
}

.tm-tree-expand {
    width: 20px;
    text-align: center;
    font-size: 12px;
    margin-right: 5px;
    color: #64748b;
}

.tm-tree-icon {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.tm-tree-label {
    flex: 1;
    font-size: 14px;
}

.tm-tree-actions {
    opacity: 0;
    display: flex;
    gap: 4px;
    transition: opacity 0.2s ease;
}

.tm-tree-node:hover .tm-tree-actions {
    opacity: 1;
}

.tm-tree-action {
    padding: 2px 6px;
    border-radius: 4px;
    border: none;
    background: rgba(0,0,0,0.1);
    color: inherit;
    font-size: 11px;
    cursor: pointer;
}

.tm-tree-action:hover {
    background: rgba(0,0,0,0.2);
}

.tm-tree-children {
    margin-left: 20px;
    border-left: 1px dashed #e2e8f0;
    padding-left: 10px;
}

/* Statistics Cards */
.tm-stats-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.tm-stats-card {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s ease;
    border: none;
    min-height: 100px;
}

.tm-stats-card:hover { 
    transform: translateY(-2px); 
}

.tm-stats-card.success { 
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); 
}

.tm-stats-card.danger { 
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa8a8 100%); 
}

.tm-stats-card.warning { 
    background: linear-gradient(135deg, #ffd93d 0%, #ff6b6b 100%); 
}

.tm-stats-card.info { 
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%); 
}

/* Content Cards */
.tm-test-detail-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--tm-border);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tm-test-item {
    background: white;
    border: 1px solid var(--tm-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tm-test-item:hover {
    border-color: var(--tm-primary);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

/* Badges */
.tm-priority-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.tm-priority-critical { 
    background: #fef2f2; 
    color: #dc2626; 
}

.tm-priority-high { 
    background: #fef3c7; 
    color: #d97706; 
}

.tm-priority-medium { 
    background: #dbeafe; 
    color: #2563eb; 
}

.tm-priority-low { 
    background: #f0fdf4; 
    color: #16a34a; 
}

.tm-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tm-status-passed { 
    background: #dcfce7; 
    color: #16a34a; 
}

.tm-status-failed { 
    background: #fef2f2; 
    color: #dc2626; 
}

.tm-status-blocked { 
    background: #fef3c7; 
    color: #d97706; 
}

.tm-status-pending { 
    background: #f1f5f9; 
    color: #64748b; 
}

.tm-status-in-progress { 
    background: #dbeafe; 
    color: #2563eb; 
}

/* Search Box */
.tm-search-box {
    position: relative;
    flex: 1;
}

.tm-search-box input {
    padding-left: 40px;
    border-radius: 25px;
    border: 1px solid var(--tm-border);
    width: 100%;
}

.tm-search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

/* Resizer */
.tm-resizer {
    width: 4px;
    background: transparent;
    cursor: col-resize;
    position: relative;
}

.tm-resizer:hover {
    background: var(--tm-primary);
}

/* Dropdown Submenus */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -6px;
    margin-left: -1px;
}

.dropdown-submenu:hover .dropdown-menu {
    display: block;
}

/* Toast Container */
.tm-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1055;
}

/* Grid View */
.tm-grid-view .tm-test-item {
    display: inline-block;
    width: calc(33.333% - 10px);
    margin: 5px;
    vertical-align: top;
}

.tm-grid-view .tm-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tm-fullscreen-container {
        flex-direction: column;
    }
    
    .tm-sidebar {
        width: 100%;
        height: 40%;
    }
    
    .tm-stats-row {
        flex-direction: column;
    }
    
    .dropdown-submenu .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
    }
}