/* VoxQualify Custom Styles */

:root {
    --vq-primary: #2563eb;
    --vq-secondary: #8b5cf6;
    --vq-success: #10b981;
    --vq-danger: #ef4444;
    --vq-warning: #f59e0b;
    --vq-info: #06b6d4;
    --vq-light: #f9fafb;
    --vq-dark: #111827;
    --vq-sidebar-width: 260px;
    --vq-topbar-height: 64px;
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--vq-dark);
    background-color: var(--vq-light);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--vq-sidebar-width);
    background: white;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--vq-primary);
    margin: 0;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-nav-item:hover {
    background-color: #f3f4f6;
    color: var(--vq-primary);
}

.sidebar-nav-item.active {
    background-color: #eff6ff;
    color: var(--vq-primary);
    border-right: 3px solid var(--vq-primary);
}

.sidebar-nav-item i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.main-content {
    margin-left: var(--vq-sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--vq-topbar-height);
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

.page-content {
    padding: 2rem;
    flex: 1;
}

/* Mobile Sidebar */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.card-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-card-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-icon.primary {
    background: #eff6ff;
    color: var(--vq-primary);
}

.stat-card-icon.success {
    background: #d1fae5;
    color: var(--vq-success);
}

.stat-card-icon.warning {
    background: #fef3c7;
    color: var(--vq-warning);
}

.stat-card-icon.danger {
    background: #fee2e2;
    color: var(--vq-danger);
}

.stat-card-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

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

.stat-card-change {
    font-size: 0.875rem;
}

.stat-card-change.positive {
    color: var(--vq-success);
}

.stat-card-change.negative {
    color: var(--vq-danger);
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

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

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

/* Badges */
.badge {
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    border-radius: 4px;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-info {
    background-color: #cffafe;
    color: #155e75;
}

.badge-secondary {
    background-color: #f3f4f6;
    color: #4b5563;
}

/* Tables */
.table {
    background: white;
}

.table thead th {
    background-color: #f9fafb;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e5e7eb;
    padding: 1rem;
}

.table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: #f9fafb;
    cursor: pointer;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: var(--vq-dark);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--vq-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-text {
    font-size: 0.875rem;
    color: #6b7280;
}

.invalid-feedback {
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

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

.empty-state-text {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 5rem;
    right: 1rem;
    z-index: 9999;
}

.toast {
    min-width: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.toast-header {
    border-bottom: none;
    padding: 0.75rem 1rem;
}

.toast-body {
    padding: 0.75rem 1rem;
}

/* Loading States */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e5e7eb;
}

.progress-bar {
    background-color: var(--vq-primary);
    border-radius: 4px;
}

/* Dropdown */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.625rem 1rem;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
}

.dropdown-item i {
    width: 20px;
    margin-right: 0.5rem;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

/* Utilities */
.text-muted {
    color: #6b7280 !important;
}

.border-top {
    border-top: 1px solid #e5e7eb !important;
}

.border-bottom {
    border-bottom: 1px solid #e5e7eb !important;
}

.shadow-sm {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.shadow {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* Authentication Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--vq-primary) 0%, var(--vq-secondary) 100%);
}

.auth-card {
    max-width: 480px;
    width: 100%;
    margin: 2rem;
}

.auth-card .card {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--vq-primary);
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--vq-dark);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: #6b7280;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Grid Layouts */
.agent-grid, .flow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.agent-card, .flow-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .page-content {
        padding: 1rem;
    }

    .topbar {
        padding: 0 1rem;
    }

    .stat-card-value {
        font-size: 1.5rem;
    }

    .table {
        font-size: 0.875rem;
    }

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