/* Custom Styles for Streak CRM Management System */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bs-bg-opacity: 1;
    background-color: #1a1a1a !important;
    color: #e9ecef !important;
}

[data-theme="dark"] .card {
    background-color: #2d2d2d;
    color: #e9ecef;
    border-color: #444;
}

[data-theme="dark"] .navbar {
    background-color: #2d2d2d !important;
}

[data-theme="dark"] .table {
    color: #e9ecef;
}

[data-theme="dark"] .modal-content {
    background-color: #2d2d2d;
    color: #e9ecef;
}

/* Layout */
body {
    padding-top: 56px;
}

main {
    min-height: calc(100vh - 56px);
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
}

.nav-link {
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* KPI Cards */
.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning {
    border: none;
}

.card-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* Pipeline Cards */
.pipeline-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.pipeline-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.pipeline-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
}

/* Task Columns */
.task-column {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.task-card {
    cursor: move;
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

.task-card.priority-high {
    border-left-color: var(--danger-color);
}

.task-card.priority-medium {
    border-left-color: var(--warning-color);
}

.task-card.priority-low {
    border-left-color: var(--success-color);
}

.sortable-ghost {
    opacity: 0.4;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length select {
    width: auto;
    display: inline-block;
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 0.5em;
    display: inline-block;
    width: auto;
}

/* Loading States */
.skeleton {
    animation: skeleton-loading 1s linear infinite alternate;
}

@keyframes skeleton-loading {
    0% {
        background-color: hsl(200, 20%, 80%);
    }
    100% {
        background-color: hsl(200, 20%, 95%);
    }
}

.skeleton-text {
    width: 100%;
    height: 0.7rem;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .pipeline-card {
        margin-bottom: 1rem;
    }
    
    .task-column {
        min-height: 200px;
        margin-bottom: 1rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
}

/* Utilities */
.cursor-pointer {
    cursor: pointer;
}

.hover-bg-light:hover {
    background-color: var(--light-color);
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
}

/* Box List Items */
.box-item {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s;
}

.box-item:hover {
    background-color: var(--light-color);
}

.box-item:last-child {
    border-bottom: none;
}

.box-stage {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    background-color: var(--info-color);
    color: white;
}

/* Stage columns for Kanban view */
.stage-column {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    min-height: 500px;
    margin-bottom: 15px;
}

[data-theme="dark"] .stage-column {
    background: #2d2d2d;
    border: 1px solid #444;
}

.stage-header {
    font-weight: 600;
    margin-bottom: 15px;
    padding: 10px;
    background: #e9ecef;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="dark"] .stage-header {
    background: #1a1a1a;
}

.box-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: move;
    transition: all 0.2s;
}

[data-theme="dark"] .box-card {
    background: #3d3d3d;
    border-color: #555;
}

.box-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.box-card.dragging {
    opacity: 0.5;
}

.stage-column.drag-over {
    background: #e7f3ff;
    border: 2px dashed #0d6efd;
}

[data-theme="dark"] .stage-column.drag-over {
    background: #1a3d5c;
    border-color: #4a90e2;
}

.box-value {
    color: #28a745;
    font-weight: 600;
}

.pipeline-stats-row {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

[data-theme="dark"] .pipeline-stats-row {
    background: #2d2d2d;
}

.stat-card {
    text-align: center;
    padding: 15px;
}

.stat-card h3 {
    margin-bottom: 5px;
    color: #0d6efd;
}

[data-theme="dark"] .stat-card h3 {
    color: #4a90e2;
}

.stat-card p {
    margin: 0;
    color: #6c757d;
}

[data-theme="dark"] .stat-card p {
    color: #a0a0a0;
}

/* Action Buttons */
.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-box input {
    padding-left: 2.5rem;
}

/* Progress Bars */
.progress-thin {
    height: 4px;
}

/* Status Badges */
.badge-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    font-weight: normal;
}

/* Tooltips */
.tooltip-inner {
    max-width: 300px;
}

/* Filter Builder Styles */
.filter-builder {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.filter-builder-header h5 {
    color: #333;
    font-weight: 600;
}

.filter-item {
    background: white;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    transition: all 0.2s;
}

.filter-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group .card {
    border: 2px solid #0d6efd;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.1);
}

.filter-group .card-header {
    background: #e7f1ff;
    border-bottom: 1px solid #0d6efd;
}

.filter-logic {
    max-width: 80px;
    font-weight: 600;
    background: #e7f1ff;
    border-color: #0d6efd;
}

.filter-builder-footer {
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

/* Stage Builder Styles */
.stage-builder {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow-x: auto;
    min-height: 80px;
}

[data-theme="dark"] .stage-builder {
    background: #2d2d2d;
}

.stage-builder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px 15px;
    min-width: 200px;
}

[data-theme="dark"] .stage-builder-item {
    background: #3d3d3d;
    border-color: #555;
}

.stage-builder-item .handle {
    cursor: move;
    color: #6c757d;
}

.stage-builder-item input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
}

.stage-builder-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stage-builder-item.sortable-ghost {
    opacity: 0.4;
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .page-content:not(.active) {
        display: none !important;
    }
    
    .card {
        break-inside: avoid;
    }
}