/* Scheduler Styles */

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
}

.section-actions {
    display: flex;
    gap: 1rem;
}

/* Controls Bar */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bulk-actions .btn {
    white-space: nowrap;
}

.search-container {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 400px;
}

.search-container input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.filters-group {
    display: flex;
    gap: 10px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* Buttons */
.btn-primary {
    background: #6366f1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

.data-table th {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

.selection-column,
.selection-cell {
    width: 42px;
    text-align: center;
}

.scheduler-select-checkbox {
    cursor: pointer;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.service-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.service-cell small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.badge-secondary {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

/* Progress Bar */
.progress-bar {
    position: relative;
    width: 100px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.pagination {
    display: flex;
    gap: 8px;
}

.pagination button {
    min-width: 32px;
}

.pagination button.active {
    background: #6366f1;
    color: white;
}

/* Modal Styles for Schedule Form */
.service-search-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-suggestions {
    display: none;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.95);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.45);
}

.service-suggestions.active {
    display: block;
}

.service-suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.service-suggestion-item .suggestion-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 4px;
}

.service-suggestion-item .suggestion-meta {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.service-suggestion-item:hover,
.service-suggestion-item.active {
    background: rgba(99, 102, 241, 0.25);
}

.service-suggestion-empty {
    padding: 12px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.import-csv-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.import-notes {
    padding: 1rem;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.35);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

.import-notes p {
    margin: 0 0 0.5rem 0;
}

.import-notes code {
    background: rgba(15, 23, 42, 0.7);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
}

.import-result {
    margin-top: 1.5rem;
}

.import-errors {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
    list-style: disc;
}

.import-errors li {
    margin-bottom: 0.35rem;
}

.import-success-list {
    margin-top: 1rem;
}

.import-success-items {
    list-style: disc;
    margin-left: 1.25rem;
}

.import-modal h4 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.form-label.required::after {
    content: ' *';
    color: #ef4444;
}

.form-input,
.form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(255, 255, 255, 0.08);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Distribution Chart */
#distributionChart {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

#distributionCanvas {
    width: 100%;
    height: 200px;
}

.distribution-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.distribution-controls label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

#customControls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

#curveSkew {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

#curveSkew::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #6366f1;
    border-radius: 50%;
    cursor: pointer;
}

#curveSkew::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #6366f1;
    border-radius: 50%;
    cursor: pointer;
}

/* Distribution Preview */
.distribution-preview {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.interval-inputs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.interval-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.interval-field input {
    width: 80px;
}

.preview-day {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.preview-day:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #6366f1;
}

.preview-day.invalid {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.day-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.day-quantity {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

/* Order Details Modal */
.order-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row label {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
}

.detail-row span {
    color: rgba(255, 255, 255, 0.9);
}

.detail-row code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* Loading States */
.loading-cell {
    text-align: center;
    padding: 3rem !important;
    color: rgba(255, 255, 255, 0.5);
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.5);
}

.empty-state p {
    margin-bottom: 1rem;
}

/* Text Utilities */
.text-muted {
    color: rgba(255, 255, 255, 0.4);
}

.text-danger {
    color: #f87171;
}

.text-warning {
    color: #fbbf24;
}

.text-success {
    color: #4ade80;
}

/* Responsive */
@media (max-width: 768px) {
    .controls-bar {
        flex-direction: column;
        gap: 15px;
    }

    .search-container {
        max-width: 100%;
    }

    .filters-group {
        width: 100%;
        flex-direction: column;
    }

    .preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-actions {
        width: 100%;
    }
}


.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.btn-warning {
    background-color: #ffc107;
    color: #000;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn.btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

.btn i {
    margin-right: 3px;
}
