/* AccuStream Custom Styles - Phase 2 */

/* ================================
   CSS Variables
   ================================ */
:root {
    --primary-color: #0066CC;
    --primary-dark: #0052a3;
    --secondary-color: #6C757D;
    --accent-color: #28A745;
    --success-color: #28A745;
    --warning-color: #FFC107;
    --danger-color: #DC3545;
    --info-color: #17A2B8;
    --dark-color: #212529;
    --light-color: #F8F9FA;
    --border-color: #DEE2E6;
    
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 0;
    --navbar-height: 60px;
    
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ================================
   General Styles
   ================================ */
body {
    font-family: var(--font-family);
    background-color: #f5f6fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ================================
   Dashboard Wrapper
   ================================ */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ================================
   Sidebar Styles
   ================================ */
.dashboard-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.sidebar-brand:hover {
    color: var(--primary-color);
}

.sidebar-close {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
}

.sidebar-close:hover {
    color: var(--danger-color);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary-color);
}

.sidebar-nav .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
}

.sidebar-nav .nav-link i {
    font-size: 1.25rem;
    width: 2rem;
    text-align: center;
    margin-right: 0.75rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .nav-link {
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
}

.sidebar-footer .nav-link:hover {
    color: white;
}

.sidebar-footer .nav-link i {
    margin-right: 0.75rem;
}

/* Mobile Sidebar */
@media (max-width: 991.98px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
    }
    
    .dashboard-sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* ================================
   Dashboard Main Area
   ================================ */
.dashboard-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (max-width: 991.98px) {
    .dashboard-main {
        margin-left: 0;
    }
}

/* ================================
   Dashboard Navbar
   ================================ */
.dashboard-navbar {
    height: var(--navbar-height);
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-toggle {
    padding: 0;
    color: var(--dark-color);
}

.sidebar-toggle:hover {
    color: var(--primary-color);
}

/* ================================
   Dashboard Breadcrumbs
   ================================ */
.dashboard-breadcrumbs {
    padding: 1rem 1.5rem;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-breadcrumbs .breadcrumb {
    margin: 0;
    padding: 0;
    background: none;
}

.dashboard-breadcrumbs .breadcrumb-item + .breadcrumb-item::before {
    content: "/";
}

/* ================================
   Dashboard Content
   ================================ */
.dashboard-content {
    flex: 1;
    padding: 1.5rem;
    background-color: #f5f6fa;
}

/* ================================
   Status Badges
   ================================ */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

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

.badge-warning {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.badge-danger {
    background-color: var(--danger-color);
}

.badge-info {
    background-color: var(--info-color);
}

.badge-secondary {
    background-color: var(--secondary-color);
}

/* ================================
   Progress Bars
   ================================ */
.progress {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* ================================
   Cards
   ================================ */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.stat-card .stat-trend {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.stat-card .stat-trend.up {
    color: var(--success-color);
}

.stat-card .stat-trend.down {
    color: var(--danger-color);
}

/* ================================
   Tables
   ================================ */
.table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--secondary-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 102, 204, 0.02);
}

/* ================================
   Buttons
   ================================ */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ================================
   Forms
   ================================ */
.form-control {
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* ================================
   Responsive Utilities
   ================================ */
@media (max-width: 767.98px) {
    .dashboard-content {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* ================================
   Animations
   ================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert {
    animation: fadeIn 0.3s ease;
}

/* ================================
   Empty State
   ================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

/* ================================
   Pipeline Diagram
   ================================ */
.pipeline-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.pipeline-step {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-width: 120px;
}

.pipeline-step i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.pipeline-arrow {
    margin: 0 1rem;
    color: var(--secondary-color);
    font-size: 1.5rem;
}

/* ================================
   Chat Interface
   ================================ */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.chat-message {
    margin-bottom: 1rem;
    max-width: 80%;
}

.chat-message.user {
    margin-left: auto;
    text-align: right;
}

.chat-message-content {
    display: inline-block;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: var(--light-color);
}

.chat-message.user .chat-message-content {
    background: var(--primary-color);
    color: white;
}

.chat-message.bot .chat-message-content {
    background: #f0f0f0;
    color: var(--dark-color);
}

.chat-input-area {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

/* ================================
   Quick Action Chips
   ================================ */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.quick-action-chip {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-chip:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
