/* Sales Pipeline Styles */

.pipeline-header {
    padding: 30px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}

.pipeline-header h1 {
    margin: 0;
    font-size: 28px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pipeline-header .subtitle {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 14px;
}

/* Pipeline Type Toggle */
.pipeline-type-toggle {
    display: flex;
    gap: 10px;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 15px;
}

.pipeline-toggle-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pipeline-toggle-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pipeline-toggle-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.pipeline-filter {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 15px;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.time-filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-filter-select:hover {
    border-color: var(--primary-color);
}

.time-filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 115, 234, 0.1);
}

.pipeline-board {
    display: flex;
    gap: 20px;
    padding: 20px;
    overflow-x: auto;
    min-height: calc(100vh - 200px);
    background: #f7f8fa;
}

.pipeline-column {
    flex: 1;
    min-width: 300px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 220px);
}

.column-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.lead-count {
    background: var(--primary-color);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.column-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lead-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    cursor: move;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #ddd;
}

/* Follow-up pipeline card status colors */
.lead-card.status-green {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.05) 0%, rgba(39, 174, 96, 0.02) 100%);
}

.lead-card.status-white {
    border-left-color: #ddd;
    background: #fff;
}

.lead-card.status-red {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.05) 0%, rgba(231, 76, 60, 0.02) 100%);
}

/* Quick Send Button */
.quick-send-btn {
    width: 100%;
    padding: 10px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.quick-send-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 115, 234, 0.3);
}

.quick-send-btn:active {
    transform: translateY(0);
}

/* Modal Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 115, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

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

.lead-card.sortable-ghost {
    opacity: 0.4;
}

.lead-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.lead-card-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-color);
    margin: 0;
    flex: 1;
}

.lead-card-actions {
    display: flex;
    gap: 5px;
}

.lead-card-actions button {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.lead-card-actions button:hover {
    background: #f0f0f0;
    color: var(--primary-color);
}

.lead-card-info {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

.lead-card-info i {
    margin-right: 8px;
    width: 16px;
    color: var(--primary-color);
}

.lead-card-value {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 16px;
}

.lead-card-notes {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #666;
    font-style: italic;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.add-card-btn {
    margin: 15px;
    padding: 10px;
    background: transparent;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.add-card-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f0f7ff;
}

/* Column Stage Colors */
.pipeline-column[data-stage="new-lead"] .column-header {
    border-bottom-color: #3498db;
}

.pipeline-column[data-stage="new-lead"] .lead-count {
    background: #3498db;
}

.pipeline-column[data-stage="contacted-quote"] .column-header {
    border-bottom-color: #9b59b6;
}

.pipeline-column[data-stage="contacted-quote"] .lead-count {
    background: #9b59b6;
}

.pipeline-column[data-stage="engaged"] .column-header {
    border-bottom-color: #f39c12;
}

.pipeline-column[data-stage="engaged"] .lead-count {
    background: #f39c12;
}

.pipeline-column[data-stage="not-booked"] .column-header {
    border-bottom-color: #e74c3c;
}

.pipeline-column[data-stage="not-booked"] .lead-count {
    background: #e74c3c;
}

.pipeline-column[data-stage="booked"] .column-header {
    border-bottom-color: #27ae60;
}

.pipeline-column[data-stage="booked"] .lead-count {
    background: #27ae60;
}

.pipeline-column[data-stage="lost"] .column-header {
    border-bottom-color: #95a5a6;
}

.pipeline-column[data-stage="lost"] .lead-count {
    background: #95a5a6;
}

.pipeline-column[data-stage="replied"] .column-header {
    border-bottom-color: #27ae60;
}

.pipeline-column[data-stage="replied"] .lead-count {
    background: #27ae60;
}

.pipeline-column[data-stage="custom"] .column-header {
    border-bottom-color: #e67e22;
}

.pipeline-column[data-stage="custom"] .lead-count {
    background: #e67e22;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--text-color);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f0f0f0;
    color: var(--text-color);
}

.modal-body {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    position: sticky;
    bottom: 0;
    background: #fff;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 115, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: #005bb5;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 234, 0.3);
}

.btn-secondary {
    background: #f0f0f0;
    color: var(--text-color);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.4;
    color: #ccc;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #999;
}

/* Scrollbar Styling */
.column-content::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.column-content::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.column-content::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.column-content::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.loading i {
    font-size: 32px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
