* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --success-color: #16a34a;
    --warning-color: #ea580c;
    --danger-color: #dc2626;
    --bg-dark: #1e293b;
    --bg-darker: #0f172a;
    --bg-light: #f1f5f9;
    --text-dark: #0f172a;
    --text-light: #64748b;
    --border-color: #334155;
    --card-bg: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-darker);
    color: white;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.board-header {
    background: var(--bg-dark);
    padding: 1rem 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.board-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin: 0;
    justify-self: start;
}

.center-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-self: center;
    align-items: center;
}

.location-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-darker);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.location-label {
    font-weight: 600;
    color: #94a3b8;
    font-size: 0.9rem;
}

.current-location {
    font-weight: 700;
    color: #e2e8f0;
    font-size: 1rem;
}

.btn-gear {
    background: var(--bg-darker);
    color: #94a3b8;
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-gear:hover {
    background: var(--bg-dark);
    color: #e2e8f0;
    border-color: #475569;
    transform: rotate(90deg);
}

.role-filter {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.role-filter label {
    font-weight: 600;
    color: #94a3b8;
    font-size: 0.9rem;
}

.role-dropdown-button {
    background: var(--bg-darker);
    color: white;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 150px;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.role-dropdown-button:hover {
    background: var(--bg-dark);
    border-color: #475569;
}

.role-dropdown-button.open {
    border-color: var(--primary-color);
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.role-dropdown-button.open .dropdown-arrow {
    transform: rotate(180deg);
}

.role-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    display: none;
}

.role-dropdown-menu.show {
    display: block;
}

.role-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s ease;
    color: white;
}

.role-checkbox-item:hover {
    background: var(--bg-darker);
}

.role-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.role-checkbox-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

.role-checkbox-item input[type="checkbox"]:checked + span {
    color: var(--primary-color);
}

#currentTime {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    text-align: right;
    line-height: 1.4;
    min-width: 120px;
    justify-self: end;
}

.board-container {
    max-width: 100%;
    width: 100%;
    padding: 1rem;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

/* Custom Scrollbar */
.board-container::-webkit-scrollbar {
    width: 8px;
}

.board-container::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

.board-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.board-container::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

#assignmentBoard {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.employee-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    display: grid;
    grid-template-columns: 240px 1fr 1fr 240px;
    gap: 2rem;
    align-items: center;
    transition: all 0.2s ease;
}

.employee-card:hover {
    border-color: #475569;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.employee-card.in-progress {
    border-left: 4px solid var(--success-color);
}

.employee-card.paused {
    border-left: 4px solid var(--warning-color);
}

.employee-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    overflow: hidden;
}

.employee-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.employee-details {
    display: block;
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.4;
}

.employee-role {
    color: #60a5fa;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
    display: block;
}

.shift-times {
    color: #94a3b8;
    white-space: nowrap;
    display: block;
    margin-top: 0.15rem;
}

.details-separator {
    color: #475569;
    margin: 0 0.25rem;
}

.location-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.assignment-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
    overflow: hidden;
}

.assignment-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.assignment-value {
    font-size: 0.95rem;
    color: #e2e8f0;
    font-weight: 500;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
}

.assignment-value.no-assignment {
    color: #64748b;
    font-style: italic;
}

.assignment-title-text {
    /* Don't use flex: 1 - let it take natural width */
    overflow: hidden;
    text-overflow: ellipsis;
}

.assignment-time-display {
    flex-shrink: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(22, 163, 74, 0.1);
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
}

.assignment-time-display.paused {
    background: rgba(234, 88, 12, 0.1);
}

.time-elapsed {
    color: var(--success-color);
    font-weight: 700;
    font-size: 1rem;
}

.assignment-time-display.paused .time-elapsed {
    color: var(--warning-color);
}

.time-separator {
    color: #64748b;
    font-weight: 400;
}

.time-remaining {
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.85rem;
}

.assignment-time-display.paused .time-remaining {
    color: #94a3b8;
}

.time-display {
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--success-color);
    text-align: center;
    letter-spacing: 1px;
}

.time-display.paused {
    color: var(--warning-color);
}

.shift-countdown {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.shift-countdown.late {
    color: var(--danger-color);
    background: rgba(220, 38, 38, 0.1);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-start {
    background: var(--primary-color);
    color: white;
}

.btn-start:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-pause {
    background: var(--warning-color);
    color: white;
}

.btn-pause:hover:not(:disabled) {
    background: #c2410c;
    transform: translateY(-1px);
}

.btn-complete {
    background: var(--success-color);
    color: white;
}

.btn-complete:hover:not(:disabled) {
    background: #15803d;
    transform: translateY(-1px);
}

.no-employees {
    text-align: center;
    padding: 3rem;
    color: #64748b;
    font-size: 1.1rem;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
    font-size: 1.1rem;
}

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

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: #e2e8f0;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: var(--bg-darker);
    color: #e2e8f0;
}

.modal-step {
    display: none;
}

.modal-step.active {
    display: block;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: white;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: var(--bg-darker);
    color: #94a3b8;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-dark);
    color: #e2e8f0;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: var(--text-dark);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 2000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background: var(--success-color);
    color: white;
}

.notification.error {
    background: var(--danger-color);
    color: white;
}

.notification.warning {
    background: var(--warning-color);
    color: white;
}

.notification.info {
    background: var(--primary-color);
    color: white;
}

/* Animation for new cards only */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.employee-card {
    animation: slideIn 0.3s ease;
}

.employee-card.no-animation {
    animation: none;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .employee-card {
        grid-template-columns: 220px 1fr 1fr 220px;
        gap: 1.5rem;
        padding: 0.875rem 1.25rem;
    }
}

@media (max-width: 1200px) {
    .employee-card {
        grid-template-columns: 200px 1fr 1fr 200px;
        gap: 1.25rem;
        font-size: 0.9rem;
    }
    
    .employee-name {
        font-size: 1rem;
    }
    
    .time-display {
        font-size: 1.2rem;
    }
}

@media (max-width: 1024px) {
    .board-header {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    .board-header h1 {
        justify-self: center;
    }
    
    .center-controls {
        justify-self: center;
    }
    
    #currentTime {
        justify-self: center;
    }
    
    .employee-card {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .assignment-info {
        display: grid;
        grid-template-columns: 100px 1fr;
        align-items: center;
        gap: 0.5rem;
    }
    
    .assignment-label {
        margin-bottom: 0;
    }
    
    .card-actions {
        justify-content: flex-start;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
}

@media (max-width: 768px) {
    .board-header h1 {
        font-size: 1.5rem;
    }
    
    .employee-card {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Portrait orientation for large displays */
@media (orientation: portrait) and (min-height: 1024px) {
    .employee-card {
        padding: 1.25rem 1.75rem;
        margin-bottom: 1rem;
    }
    
    .employee-name {
        font-size: 1.2rem;
    }
    
    .time-display {
        font-size: 1.6rem;
    }
}
