/* Shift Scheduling Styles - Mission Control Design */

/* Header uses main site styling from styles.css */

/* Settings Button Styling - Copied from Mission Control */
.settings-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.settings-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Page title is now in the header banner */

.campaign-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

/* When modal is open, disable interactions with page elements */
body.modal-open .campaign-section,
body.modal-open .schedule-section,
body.modal-open #campaign-select,
body.modal-open .form-select {
    pointer-events: none;
    opacity: 0.6;
}

.schedule-section {
    margin-top: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0;
    background: transparent;
    border: none;
}

.section-header h2 {
    margin: 0;
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
}

.schedule-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.campaign-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Schedule Grid */
.schedule-grid-container {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 0;
    border: none;
}

.schedule-grid {
    width: 100%;
    min-width: 1000px;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.schedule-grid th {
    background: #f8fafc;
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.schedule-grid td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.schedule-grid tr:hover {
    background: #f9fafb;
}

/* Brand Column */
.brand-cell {
    font-weight: 600;
    color: #1f2937;
    min-width: 120px;
    position: sticky;
    left: 0;
    background: white;
    z-index: 5;
}

.brand-cell.inactive {
    color: #9ca3af;
    font-style: italic;
}

/* Date Column */
.date-cell {
    min-width: 100px;
    text-align: center;
    font-weight: 500;
}

.date-header {
    text-align: center;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Shift Cells */
.shift-cell {
    min-width: 220px;
    position: relative;
    padding: 0.5rem;
}

.shift-cell.inactive {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
    border-radius: 8px;
}

.shift-cell.inactive .shift-content {
    opacity: 0.6;
}

.shift-content {
    min-height: 60px;
    padding: 0.75rem;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shift-content:hover {
    background: #e0f2fe;
    border-color: #0ea5e9;
}

.shift-content.assigned {
    background: #dcfce7;
    border-color: #22c55e;
}

.shift-content.assigned:hover {
    background: #bbf7d0;
}

/* Assignment Display */
.assignment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    font-size: 0.75rem;
}

.assignment:last-child {
    margin-bottom: 0;
}

.assignment-user {
    font-weight: 500;
    color: #1f2937;
}

.assignment-marketplace {
    color: #6b7280;
    font-size: 0.625rem;
}

.assignment-status {
    padding: 0.125rem 0.375rem;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 500;
}

.assignment-status.assigned {
    background: #dbeafe;
    color: #1e40af;
}

.assignment-status.confirmed {
    background: #dcfce7;
    color: #166534;
}

.assignment-status.completed {
    background: #f0fdf4;
    color: #15803d;
}

/* Add Assignment Button */
.add-assignment-btn {
    width: 100%;
    padding: 0.5rem;
    background: #f8fafc;
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    color: #6b7280;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-assignment-btn:hover {
    background: #e0f2fe;
    border-color: #0ea5e9;
    color: #0ea5e9;
}

/* Preferences Section */
.preferences-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

.preferences-grid {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.preferences-filters {
    display: flex;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.preferences-grid-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.preference-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

.preference-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.preference-card-title {
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.preference-level {
    display: flex;
    gap: 0.25rem;
}

.preference-level input[type="radio"] {
    margin: 0;
}

.preference-level label {
    font-size: 0.75rem;
    color: #6b7280;
    cursor: pointer;
}

.preference-details {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 100000;
    pointer-events: auto;
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #374151;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

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

.date-range-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-range-selector span {
    color: #6b7280;
    font-size: 0.875rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* User Checkboxes */
.user-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.75rem;
}

.user-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
}

.user-checkbox input[type="checkbox"] {
    margin: 0;
}

.user-checkbox label {
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    margin: 0;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #0ea5e9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .schedule-grid-container {
        overflow-x: auto;
    }
    
    .schedule-grid {
        min-width: 800px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .schedule-controls {
        flex-wrap: wrap;
    }
    
    .preferences-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-indicator.assigned {
    background: #3b82f6;
}

.status-indicator.confirmed {
    background: #22c55e;
}

.status-indicator.completed {
    background: #10b981;
}

.status-indicator.cancelled {
    background: #ef4444;
}

/* Tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}
