/* Queue Monitor Styles */
.queue-monitor {
    padding: 20px;
    background: #f5f5f5;
    min-height: 100vh;
}

.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.monitor-header h1 {
    margin: 0;
    color: #333;
    font-size: 1.8em;
}

.status-legend {
    display: flex;
    gap: 20px;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.available { background: #28a745; }
.status-dot.busy { background: #dc3545; }
.status-dot.paused { background: #ffc107; }
.status-dot.offline { background: #6c757d; }

.auto-refresh {
    color: #666;
    font-size: 14px;
}

.queues-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.queue-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.queue-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.queue-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.queue-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.3em;
    font-weight: 600;
}

.queue-description {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 3px;
}

.queue-group {
    font-size: 0.8em;
    opacity: 0.8;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.queue-stats {
    display: flex;
    gap: 15px;
}

.stat-item {
    text-align: center;
    background: rgba(255,255,255,0.2);
    padding: 8px 12px;
    border-radius: 8px;
    min-width: 60px;
}

.stat-item .count {
    display: block;
    font-size: 1.4em;
    font-weight: bold;
}

.stat-item .label {
    display: block;
    font-size: 0.75em;
    opacity: 0.9;
    margin-top: 2px;
}

.queue-body {
    padding: 20px;
}

.queue-body h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

.extensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.extension-item {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

.extension-item.available {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.extension-item.busy {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
    animation: pulse 2s infinite;
}

.extension-item.paused {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.extension-item.offline {
    background: #e2e3e5;
    border-color: #6c757d;
    color: #495057;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.extension-number {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 4px;
}

.extension-name {
    font-size: 0.85em;
    opacity: 0.8;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.call-timer {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #dc3545;
    color: white;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

.pause-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 0.9em;
}

.waiting-calls-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
}

.waiting-calls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.waiting-call {
    display: flex;
    align-items: center;
    background: #fff8e1;
    border: 1px solid #ffecb3;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.waiting-call:hover {
    background: #fff3c4;
    border-color: #ffc107;
}

.call-position {
    background: #ff9800;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    padding: 4px 8px;
    border-radius: 50%;
    min-width: 30px;
    text-align: center;
    margin-right: 15px;
}

.call-number {
    font-weight: bold;
    font-size: 1.1em;
    margin-right: 15px;
    color: #333;
    min-width: 120px;
}

.call-name {
    flex: 1;
    color: #666;
    margin-right: 15px;
}

.wait-time {
    font-weight: bold;
    color: #d32f2f;
    font-size: 1.1em;
    animation: blink 2s infinite;
}

.no-extensions {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.empty-state {
    text-align: center;
    color: #666;
    font-size: 1.2em;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.custom-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    max-width: 300px;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    pointer-events: none;
}

.custom-tooltip strong {
    color: #ffc107;
}

/* Responsive Design */
@media (max-width: 768px) {
    .queues-container {
        grid-template-columns: 1fr;
    }
    
    .monitor-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .status-legend {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .queue-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .queue-stats {
        justify-content: center;
    }
    
    .extensions-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .waiting-call {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Print styles */
@media print {
    .queue-monitor {
        background: white;
    }
    
    .queue-card {
        break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .monitor-header {
        box-shadow: none;
        border-bottom: 2px solid #ddd;
    }
}