/**
 * Global Request Banner Styles
 * 헤더 하단에 표시되는 pending/accepted 의뢰 배너
 */

/* ===========================================
   Global Request Banner
   =========================================== */
.global-request-banner {
    position: absolute;
    top: 100%;  /* 헤더 바로 아래에 위치 */
    left: 0;
    right: 0;
    z-index: 99;
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    gap: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    animation: globalBannerSlideDown 0.3s ease-out;
}

@keyframes globalBannerSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Status-based colors */
.global-request-banner.pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 2px solid #f59e0b;
}

.global-request-banner.accepted {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-bottom: 2px solid #10b981;
}

.global-request-banner.in-call {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-bottom: 2px solid #3b82f6;
}

/* Content section */
.global-request-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.global-request-content:hover {
    opacity: 0.9;
}

.global-request-status {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
    text-transform: uppercase;
}

.global-request-banner.pending .global-request-status {
    background: #f59e0b;
    color: white;
}

.global-request-banner.accepted .global-request-status {
    background: #10b981;
    color: white;
}

.global-request-banner.in-call .global-request-status {
    background: #3b82f6;
    color: white;
}

.global-request-peer {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    flex-shrink: 0;
}

.global-request-text {
    font-size: 13px;
    color: #4b5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* Timer */
.global-request-timer {
    font-size: 14px;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    padding: 3px 10px;
    border-radius: 6px;
    flex-shrink: 0;
    animation: globalTimerPulse 2s ease-in-out infinite;
}

.global-request-banner.pending .global-request-timer {
    background: rgba(245, 158, 11, 0.2);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.global-request-banner.accepted .global-request-timer {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.global-request-timer.urgent {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #dc2626 !important;
    border-color: rgba(220, 38, 38, 0.4) !important;
    animation: globalTimerUrgent 0.5s ease-in-out infinite;
}

.global-request-timer.expired {
    background: #e5e7eb;
    color: #6b7280;
    border-color: #d1d5db;
    animation: none;
}

@keyframes globalTimerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

@keyframes globalTimerUrgent {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Actions section */
.global-request-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.global-request-btn {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s, opacity 0.1s;
    white-space: nowrap;
}

.global-request-btn:active {
    transform: scale(0.95);
}

.global-request-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.global-request-btn.accept {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.global-request-btn.accept:hover:not(:disabled) {
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.4);
}

.global-request-btn.reject {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.global-request-btn.reject:hover:not(:disabled) {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

.global-request-btn.cancel {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.global-request-btn.cancel:hover:not(:disabled) {
    background: #fecaca;
}

.global-request-btn.start-call {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.global-request-btn.start-call:hover:not(:disabled) {
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.4);
}

/* ===========================================
   Dark Mode
   =========================================== */
@media (prefers-color-scheme: dark) {
    .global-request-banner.pending {
        background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
        border-bottom-color: #f59e0b;
    }

    .global-request-banner.accepted {
        background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
        border-bottom-color: #10b981;
    }

    .global-request-banner.in-call {
        background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
        border-bottom-color: #3b82f6;
    }

    .global-request-peer {
        color: #f9fafb;
    }

    .global-request-text {
        color: #d1d5db;
    }

    .global-request-banner.pending .global-request-timer {
        background: rgba(245, 158, 11, 0.3);
        color: #fbbf24;
    }

    .global-request-banner.accepted .global-request-timer {
        background: rgba(16, 185, 129, 0.3);
        color: #34d399;
    }

    .global-request-btn.reject {
        background: rgba(255, 255, 255, 0.1);
        color: #d1d5db;
        border-color: rgba(255, 255, 255, 0.2);
    }

    .global-request-btn.reject:hover:not(:disabled) {
        background: rgba(220, 38, 38, 0.2);
        color: #f87171;
        border-color: rgba(220, 38, 38, 0.4);
    }

    .global-request-btn.cancel {
        background: rgba(220, 38, 38, 0.2);
        color: #f87171;
        border-color: rgba(220, 38, 38, 0.4);
    }
}

/* ===========================================
   Mobile Responsive
   =========================================== */
@media (max-width: 480px) {
    .global-request-banner {
        padding: 8px 12px;
        gap: 8px;
    }

    .global-request-content {
        gap: 6px;
    }

    .global-request-status {
        font-size: 10px;
        padding: 2px 6px;
    }

    .global-request-peer {
        font-size: 13px;
    }

    .global-request-text {
        display: none;  /* 모바일에서 텍스트 숨김 */
    }

    .global-request-timer {
        font-size: 12px;
        padding: 2px 8px;
    }

    .global-request-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}
