/* kanban.css - Professional Kanban Board */

.kanban-container {
    width: 100%;
    background: var(--background-color);
    height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.kanban-title {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

/* Metrics container with improved responsive design */
.metrics-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
    padding: 0;
}

/* Kanban board with horizontal scroll and proper viewport handling */
.kanban-board-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.kanban-board {
    display: flex;
    gap: 16px;
    height: 100%;
    overflow-x: auto;
    padding: 4px 4px 40px 4px;
    scroll-behavior: smooth;
    position: relative;
    /* Hide default scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.kanban-board::-webkit-scrollbar {
    display: none;
}

/* Horizontal scroll indicators */
.kanban-board::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(to right, rgba(248, 250, 252, 0.8), transparent);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kanban-board::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(to left, rgba(248, 250, 252, 0.8), transparent);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kanban-board.can-scroll-left::before {
    opacity: 1;
}

.kanban-board.can-scroll-right::after {
    opacity: 1;
}

.metric-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    position: relative;
}

.metric-box:hover {
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.kanban-column {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.kanban-column:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.metric-value {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1;
}

.metric-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.kanban-column-icon {
    width: 16px;
    height: 16px;
    color: #6b7280;
}

.kanban-column h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.kanban-column-count {
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: auto;
}


.kanban-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    padding: 2px 16px 2px 0;
    min-height: 0;
    position: relative;
    scroll-behavior: smooth;
    /* Hide default scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.kanban-items::-webkit-scrollbar {
    display: none;
}

/* Vertical scroll indicators */
.kanban-items::before {
    content: '';
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to bottom, #f8fafc, transparent);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kanban-items::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to top, #f8fafc, transparent);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-top: -8px;
}

.kanban-items.can-scroll-up::before {
    opacity: 1;
}

.kanban-items.can-scroll-down::after {
    opacity: 1;
}

.kanban-card {
    background: white;
    border-radius: 6px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    cursor: grab;
    position: relative;
    flex-shrink: 0;
    user-select: none;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(3deg) scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.kanban-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.kanban-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-card-company {
    font-size: 11px;
    color: #6b7280;
    margin: 0;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-card-days {
    font-size: 10px;
    color: #9ca3af;
    margin: 2px 0 0 0;
}



/* Card Layout Structure */
.kanban-card-layout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    width: 100%;
}

.kanban-card-score-column {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
}

.kanban-card-info-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kanban-no-score {
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Add Job Button */
.add-job-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 13px;
    background-color: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.add-job-btn:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.add-job-icon {
    width: 12px;
    height: 12px;
}

/* Empty state styles */
.kanban-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    text-align: center;
    color: #9ca3af;
    min-height: 120px;
    flex-shrink: 0;
}

.kanban-empty-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.kanban-empty-text {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

/* Match Score Donut Chart */
.kanban-match-circle {
    width: 32px;
    height: 32px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kanban-match-circle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        #10b981 0deg,
        #10b981 var(--percentage),
        #e5e7eb var(--percentage),
        #e5e7eb 360deg
    );
}

.kanban-match-circle.excellent::before {
    background: conic-gradient(
        #10b981 0deg,
        #10b981 var(--percentage),
        #e5e7eb var(--percentage),
        #e5e7eb 360deg
    );
}

.kanban-match-circle.good::before {
    background: conic-gradient(
        #3b82f6 0deg,
        #3b82f6 var(--percentage),
        #e5e7eb var(--percentage),
        #e5e7eb 360deg
    );
}

.kanban-match-circle.fair::before {
    background: conic-gradient(
        #f97316 0deg,
        #f97316 var(--percentage),
        #e5e7eb var(--percentage),
        #e5e7eb 360deg
    );
}

.kanban-match-circle.poor::before {
    background: conic-gradient(
        #dc2626 0deg,
        #dc2626 var(--percentage),
        #e5e7eb var(--percentage),
        #e5e7eb 360deg
    );
}

.kanban-match-circle-inner {
    width: 26px;
    height: 26px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.kanban-match-percentage {
    font-size: 9px;
    font-weight: 600;
    color: #1d1d1f;
}

/* Drag and Drop Styles */
.kanban-column.drag-over-zone {
    transition: all 0.3s ease;
}

.kanban-column.drag-over {
    background: #eff6ff;
    border-color: #3b82f6;
    border-style: dashed;
    transform: scale(1.02);
}

.kanban-items.drag-over {
    background: rgba(59, 130, 246, 0.05);
    border-radius: 4px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 5% auto;
    padding: 24px;
    width: 90%;
    max-width: 480px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: 1px solid #e5e7eb;
}

.close {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    background: #f3f4f6;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close:hover {
    background: #e5e7eb;
    color: #374151;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 24px 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}

.submit-btn {
    width: 100%;
    padding: 10px 16px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.submit-btn:hover {
    background-color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}


/* Scroll hint animations */
@keyframes scrollHintRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

@keyframes scrollHintDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

/* Scroll hints */
.scroll-hint-horizontal {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(37, 99, 235, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    z-index: 20;
    opacity: 0;
    animation: scrollHintRight 2s ease-in-out infinite;
    pointer-events: none;
}

.scroll-hint-vertical {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(37, 99, 235, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    z-index: 20;
    opacity: 0;
    animation: scrollHintDown 2s ease-in-out infinite;
    pointer-events: none;
}

.kanban-board.can-scroll-right .scroll-hint-horizontal {
    opacity: 1;
}

.kanban-items.can-scroll-down .scroll-hint-vertical {
    opacity: 1;
}

/* Custom Scrollbars */
.custom-scrollbar-horizontal {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    z-index: 30;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-scrollbar-horizontal-thumb {
    height: 100%;
    background: #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.custom-scrollbar-horizontal-thumb:hover {
    background: #94a3b8;
}

.custom-scrollbar-horizontal-thumb:active {
    background: #64748b;
}

.custom-scrollbar-vertical {
    position: absolute;
    top: 8px;
    right: 4px;
    bottom: 8px;
    width: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    z-index: 30;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-scrollbar-vertical-thumb {
    width: 100%;
    background: #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.custom-scrollbar-vertical-thumb:hover {
    background: #94a3b8;
}

.custom-scrollbar-vertical-thumb:active {
    background: #64748b;
}

/* Responsive styles */
@media (max-width: 768px) {
    .kanban-container {
        padding: 12px 12px 20px 12px;
        height: 100vh;
    }
    
    .kanban-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 16px;
        flex-shrink: 0;
    }
    
    .metrics-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 16px;
        flex-shrink: 0;
    }
    
    .metric-box {
        padding: 12px;
    }
    
    .kanban-column {
        width: 260px;
        min-width: 260px;
        padding: 10px;
    }
    
    .kanban-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .metrics-container {
        grid-template-columns: 1fr;
    }
    
    .kanban-column {
        width: calc(100vw - 32px);
        min-width: calc(100vw - 32px);
    }
    
    .kanban-board {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: visible;
    }
    
    .kanban-board-wrapper {
        overflow-x: visible;
    }
}