/* --- PROFESSIONAL STYLING --- */
:root {
    --primary-color: #007bff; 
    --secondary-color: #6c757d;
    --success-color: #00c851; 
    --background-light: #f4f6f9; 
    --sidebar-color: #ffffff;
    --header-height: 50px;
}

body, html {
    height: 100%;
    margin: 0;
    font-family: 'Arial', sans-serif;
    background-color: var(--background-light);
    overflow: hidden; 
}

.app-container {
    display: flex;
    height: 100vh;
}

.app-header {
    background-color: var(--sidebar-color);
    border-bottom: 1px solid #e9ecef;
    padding: 10px 20px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

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

/* --- Tabs Styling --- */
.nav-tabs {
    border-bottom: none;
    background-color: var(--sidebar-color);
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--secondary-color);
    font-weight: 600;
    padding: 15px 20px;
    margin-right: 5px;
    transition: color 0.2s, border-bottom 0.2s;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom: 3px solid var(--primary-color);
}

/* --- Sidebar/Workspaces Styling --- */
.sidebar-container {
    width: 230px; 
    min-width: 230px;
    background-color: #ffffff;
    border-right: 1px solid #e9ecef;
    padding: 15px 0;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.sidebar-group-title {
    padding: 5px 20px;
    margin-top: 10px;
    margin-bottom: 5px;
    color: #888;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-item {
    padding: 8px 20px; 
    cursor: pointer;
    color: #495057;
    font-size: 0.9rem;
    transition: background-color 0.2s, color 0.2s;
}

.active-category {
    background-color: #e9f0ff;
    color: var(--primary-color) !important;
    border-left: 3px solid var(--primary-color);
    padding-left: 17px; 
}

.tab-pane-content {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 30px;
}

/* --- Shared Status & Progress Styling --- */
.progress { height: 16px; border-radius: 8px; background-color: #e9ecef; }
.progress-bar { background-color: var(--success-color) !important; font-size: 0.8rem; line-height: 16px; transition: width 0.3s ease; }
.pipeline-progress .progress-bar { background-color: #0056b3 !important; font-size: 0.75rem; }

.status-badge { 
    display: inline-block; padding: 5px 12px; border-radius: 5px; font-weight: 700; 
    font-size: 0.8rem; color: white; min-width: 90px; text-align: center; 
}
.status-badge.running { background-color: #ff9900; }
.status-badge.pending { background-color: #6a95ff; }
.status-badge.complete, .status-badge.finished { background-color: #00c851; }
.status-badge.paused { background-color: #7f8c8d; }
.status-badge.failed { background-color: #e25e3e; }
.status-badge.stopped { background-color: #34495e; }
.website-link { color: var(--primary-color); text-decoration: none; font-weight: 600; }
.website-link:hover { text-decoration: underline; }

/* --- Workflow Builder Styling (Cleaning Tab) --- */
.workflow-stage {
    border: 2px dashed #e9ecef;
    border-radius: 8px;
    padding: 15px;
    min-height: 250px;
    background-color: #fafbfd;
    position: relative;
}
.workflow-stage:not(:last-child) { margin-right: 40px; }
.workflow-title {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
}
.rule-card {
    margin-bottom: 10px;
    cursor: grab;
    border: 1px solid #ccc;
    border-left: 4px solid #f90; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
}
.rule-card-success { border-left: 4px solid var(--success-color); }
.rule-card-primary { border-left: 4px solid var(--primary-color); }
.drag-handle { cursor: grab; margin-right: 10px; color: #ccc; }
.card-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: none; 
    z-index: 20; /* Ensure buttons are clickable */
}
.rule-card:hover .card-actions {
    display: block;
}
.connector {
    position: absolute;
    top: 50%;
    right: -25px;
    width: 50px;
    height: 2px;
    background-color: #ccc;
    z-index: 10;
}
.arrow {
    position: absolute;
    right: -27px;
    top: -5px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid #ccc;
}
