/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f0f2f5;
    padding: 20px;
}

/* Main heading */
h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-size: 32px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Dashboard layout */
.dashboard-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Section containers */
.section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-top: 4px solid #3498db;
    width: 100%;
    min-height: 300px;
}

.section > div:first-child {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

/* Queue styles */
#queue {
    min-height: 200px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
}

#queue .queue-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    margin: 0;
    padding: 20px 15px;
    border-radius: 16px;
    border: 2px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 160px;
    height: 200px;
    justify-content: space-between;
    min-width: 160px;
    max-width: 160px;
}

.queue-position {
    font-size: 12px;
    font-weight: bold;
    color: #ffffff;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: absolute;
    top: -8px;
    right: -8px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 10;
}

#queue .queue-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #3498db;
}

#queue .queue-item:nth-child(odd) {
    border-color: #e74c3c;
}

#queue .queue-item:nth-child(even) {
    border-color: #f39c12;
}

#queue .queue-item:nth-child(3n) {
    border-color: #27ae60;
}

.customer-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 1;
    width: 100%;
}

.customer-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #ddd;
    object-fit: cover;
    transition: all 0.3s ease;
}

#queue .queue-item:hover .customer-avatar {
    border-color: #3498db;
    transform: scale(1.05);
}

.customer-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    text-align: center;
}

.customer-name {
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.customer-id {
    font-size: 11px;
    color: #7f8c8d;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    opacity: 0.8;
}

.customer-status {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    text-align: center;
}

.status-waiting {
    background-color: #fff3cd;
    color: #856404;
}

.status-servicing {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

/* Workstations styles */
#workstations {
    min-height: 200px;
}

.workstation-item {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    margin: 12px 0;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid #27ae60;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.workstation-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.workstation-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.workstation-name {
    font-weight: bold;
    font-size: 18px;
    color: #27ae60;
}

.workstation-owner {
    font-size: 14px;
    color: #2c3e50;
}

.workstation-status {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-available {
    background-color: #d4edda;
    color: #155724;
}

.status-busy {
    background-color: #f8d7da;
    color: #721c24;
}

/* Empty state messages */
.empty-queue, .empty-workstations {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 3px dashed #bdc3c7;
    font-size: 16px;
    width: 100%;
    margin: 20px 0;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-queue::before {
    content: "👥";
    display: block;
    font-size: 48px;
    margin-bottom: 10px;
}

.empty-workstations::before {
    content: "💺";
    display: block;
    font-size: 48px;
    margin-bottom: 10px;
}

/* Person-like design enhancements */
.queue-item::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #3498db 50%, transparent 100%);
    border-radius: 2px;
}

/* Minimalistic person silhouette effect */
.customer-avatar {
    position: relative;
    background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
    transition: all 0.3s ease;
}

.default-avatar {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%) !important;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.customer-avatar::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 12px;
    background: linear-gradient(135deg, #ecf0f1 0%, transparent 100%);
    border-radius: 0 0 20px 20px;
    opacity: 0.3;
}

/* Card-like appearance with person metaphor */
#queue .queue-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    box-shadow: 
        0 4px 12px rgba(0,0,0,0.08),
        inset 0 1px 0 rgba(255,255,255,0.6);
    position: relative;
    overflow: hidden;
}

#queue .queue-item::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #3498db 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#queue .queue-item:hover::after {
    opacity: 1;
}

/* Enhanced hover effects for person-like appearance */
#queue .queue-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #3498db;
}

#queue .queue-item:hover::before {
    background: linear-gradient(90deg, transparent 0%, #e74c3c 50%, transparent 100%);
}

#queue .queue-item:hover .customer-avatar {
    border-color: #3498db;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Animation styles for customer picking */
@keyframes customerPicked {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    }
    25% {
        transform: scale(1.1) translateY(-10px);
        background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
        border-color: #28a745;
        box-shadow: 0 8px 30px rgba(40, 167, 69, 0.4);
    }
    50% {
        transform: scale(1.15) translateY(-15px) rotateY(10deg);
        background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
        border-color: #17a2b8;
    }
    75% {
        transform: scale(0.8) translateY(20px);
        opacity: 0.5;
    }
    100% {
        transform: scale(0) translateY(50px);
        opacity: 0;
        width: 0;
        margin: 0;
        padding: 0;
    }
}

@keyframes customerRemoved {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    }
    25% {
        transform: scale(1.05) translateY(-5px);
        background: linear-gradient(135deg, #f8d7da 0%, #f1b0b7 100%);
        border-color: #dc3545;
        box-shadow: 0 8px 30px rgba(220, 53, 69, 0.4);
    }
    50% {
        transform: translateY(-10px) rotateZ(-10deg);
        opacity: 0.7;
    }
    75% {
        transform: translateY(30px) rotateZ(5deg);
        opacity: 0.3;
    }
    100% {
        transform: translateY(100px) rotateZ(-20deg);
        opacity: 0;
        width: 0;
        margin: 0;
        padding: 0;
    }
}

@keyframes newCustomerAdded {
    0% {
        transform: scale(0.5) translateY(-50px);
        opacity: 0;
        background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
        width: 0;
        min-width: 0;
        max-width: 0;
    }
    50% {
        transform: scale(1.1) translateY(-10px);
        opacity: 0.8;
        background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
        width: 160px;
        min-width: 160px;
        max-width: 160px;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        width: 160px;
        min-width: 160px;
        max-width: 160px;
    }
}

/* Responsive animation adjustments */
@media (max-width: 480px) {
    @keyframes newCustomerAdded {
        0% {
            transform: scale(0.5) translateY(-50px);
            opacity: 0;
            background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
            width: 0;
            min-width: 0;
            max-width: 0;
        }
        50% {
            transform: scale(1.1) translateY(-10px);
            opacity: 0.8;
            background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
            width: 140px;
            min-width: 140px;
            max-width: 140px;
        }
        100% {
            transform: scale(1) translateY(0);
            opacity: 1;
            background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
            width: 140px;
            min-width: 140px;
            max-width: 140px;
        }
    }
}

@media (max-width: 360px) {
    @keyframes newCustomerAdded {
        0% {
            transform: scale(0.5) translateY(-50px);
            opacity: 0;
            background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
            width: 0;
            min-width: 0;
            max-width: 0;
        }
        50% {
            transform: scale(1.1) translateY(-10px);
            opacity: 0.8;
            background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
            width: 120px;
            min-width: 120px;
            max-width: 120px;
        }
        100% {
            transform: scale(1) translateY(0);
            opacity: 1;
            background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
            width: 120px;
            min-width: 120px;
            max-width: 120px;
        }
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        transform: translateY(0);
    }
    50% {
        box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
        transform: translateY(-2px);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        transform: translateY(0);
    }
}

/* Animation classes */
.queue-item.picked {
    animation: customerPicked 1s ease-in-out forwards;
}

.queue-item.removed {
    animation: customerRemoved 0.8s ease-in-out forwards;
}

.queue-item.new-customer {
    animation: newCustomerAdded 0.6s ease-out forwards;
}

.queue-item.updated {
    animation: pulse 0.5s ease-in-out;
}

/* Sound control button */
.sound-control {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}

.sound-control:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.sound-control.muted {
    background: #95a5a6;
    opacity: 0.7;
}

.sound-control::before {
    content: "🔊";
    margin-right: 5px;
}

.sound-control.muted::before {
    content: "🔇";
}

/* Notification popup */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
    max-width: 300px;
}

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

.notification.removed {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.notification.added {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

/* Status change indicator */
.status-change-indicator {
    font-size: 10px;
    margin-top: 2px;
    opacity: 0.8;
    font-style: italic;
}

/* Enhanced workstation styling */
.workstation-item {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    margin: 12px 0;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid #27ae60;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.workstation-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.workstation-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.workstation-name {
    font-weight: bold;
    font-size: 18px;
    color: #27ae60;
}

.workstation-owner {
    font-size: 14px;
    color: #2c3e50;
}

.workstation-status {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-available {
    background-color: #d4edda;
    color: #155724;
}

.status-busy {
    background-color: #f8d7da;
    color: #721c24;
}

/* Responsive design - Fixed layout consistency */
@media (max-width: 1024px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    #queue .queue-item {
        width: 160px;
        height: 200px;
        min-width: 160px;
        max-width: 160px;
        padding: 20px 15px;
    }
    
    .queue-position {
        width: 24px;
        height: 24px;
        font-size: 12px;
        top: -8px;
        right: -8px;
    }
    
    #queue {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 24px;
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .section {
        padding: 20px;
    }
    
    .section > div:first-child {
        font-size: 20px;
    }
    
    #queue .queue-item {
        width: 160px;
        height: 200px;
        min-width: 160px;
        max-width: 160px;
        padding: 20px 15px;
    }
    
    .customer-avatar {
        width: 60px;
        height: 60px;
    }
    
    .customer-name {
        font-size: 14px;
    }
    
    .customer-id {
        font-size: 11px;
    }
    
    .queue-position {
        width: 24px;
        height: 24px;
        font-size: 12px;
        top: -8px;
        right: -8px;
    }
    
    #queue {
        gap: 20px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .dashboard-container {
        gap: 15px;
    }
    
    .section {
        padding: 15px;
    }
    
    #queue .queue-item {
        width: 140px;
        height: 180px;
        min-width: 140px;
        max-width: 140px;
        padding: 18px 12px;
    }
    
    .customer-avatar {
        width: 50px;
        height: 50px;
    }
    
    .customer-name {
        font-size: 13px;
    }
    
    .customer-id {
        font-size: 10px;
    }
    
    .customer-status {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .queue-position {
        width: 22px;
        height: 22px;
        font-size: 11px;
        top: -7px;
        right: -7px;
    }
    
    #queue {
        gap: 15px;
    }
}

@media (max-width: 360px) {
    #queue .queue-item {
        width: 120px;
        height: 160px;
        min-width: 120px;
        max-width: 120px;
        padding: 15px 10px;
    }
    
    .customer-avatar {
        width: 45px;
        height: 45px;
    }
    
    .customer-name {
        font-size: 12px;
    }
    
    .customer-id {
        font-size: 9px;
    }
    
    .customer-status {
        font-size: 9px;
        padding: 2px 5px;
    }
    
    .queue-position {
        width: 20px;
        height: 20px;
        font-size: 10px;
        top: -6px;
        right: -6px;
    }
    
    #queue {
        gap: 12px;
    }
}
