/* ===== HISTORY.CSS ===== */
/* Call History Panel & Callback Notification Styles */

/* ============================================================================
   HISTORY PANEL
   ============================================================================ */

.history-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(380px, 90vw);
    height: 100%;
    background: rgba(18, 18, 24, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.history-panel.visible {
    right: 0;
}

/* Header */
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.history-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-header h3::before {
    content: '📞';
    font-size: 1.1rem;
}

.history-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #aaa;
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Settings Section */
.history-settings {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.setting-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.setting-toggle span:first-child {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.setting-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 13px;
    transition: all 0.3s ease;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.setting-toggle input:checked+.toggle-slider {
    background: linear-gradient(135deg, #32d74b, #28a745);
}

.setting-toggle input:checked+.toggle-slider::after {
    left: 25px;
}

/* History List */
.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* Empty State */
.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
}

.history-empty i {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.history-empty p {
    margin: 0 0 8px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
}

.history-empty span {
    font-size: 0.85rem;
}

/* History Item */
.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.history-item:last-child {
    margin-bottom: 0;
}

/* Item Icon - simplified to single style */
.history-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(10, 132, 255, 0.15);
    color: #0a84ff;
}

.history-item-icon i {
    width: 20px;
    height: 20px;
}

/* Item Info */
.history-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-item-type {
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
}

.history-item-time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Duration Badge */
.history-item-duration {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* Callback Button */
.history-callback-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #32d74b, #28a745);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.history-callback-btn i {
    width: 18px;
    height: 18px;
}

.history-callback-btn:hover:not(.disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(50, 215, 75, 0.4);
}

.history-callback-btn.disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

/* Clear History Button */
.history-clear {
    margin: 16px 24px 24px;
    padding: 14px 24px;
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid rgba(255, 69, 58, 0.3);
    color: #ff453a;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.history-clear:hover {
    background: rgba(255, 69, 58, 0.2);
    border-color: rgba(255, 69, 58, 0.5);
}

.history-clear i {
    width: 16px;
    height: 16px;
}

/* ============================================================================
   CALLBACK NOTIFICATION BANNER (Top notification, not full-screen popup)
   ============================================================================ */

.callback-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(50, 215, 75, 0.95), rgba(40, 167, 69, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: bannerSlideIn 0.3s ease-out;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.callback-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.callback-banner-content i {
    width: 24px;
    height: 24px;
    color: #fff;
    animation: bannerPulse 1s ease-in-out infinite;
}

@keyframes bannerPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.callback-banner-content span {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.callback-banner-actions {
    display: flex;
    gap: 8px;
}

.callback-accept-btn,
.callback-reject-btn {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.callback-accept-btn {
    background: #fff;
    color: #28a745;
}

.callback-accept-btn:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.callback-reject-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.callback-reject-btn:hover {
    background: rgba(255, 69, 58, 0.8);
    border-color: transparent;
}

/* ============================================================================
   LIGHT THEME OVERRIDES
   ============================================================================ */

[data-theme="light"] .history-panel {
    background: rgba(255, 255, 255, 0.97);
    border-left-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .history-header {
    background: rgba(0, 0, 0, 0.02);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .history-header h3 {
    color: #1a1a1a;
}

[data-theme="light"] .history-close {
    background: rgba(0, 0, 0, 0.06);
    color: #666;
}

[data-theme="light"] .history-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

[data-theme="light"] .history-settings {
    background: rgba(0, 0, 0, 0.02);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .setting-toggle span:first-child {
    color: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .toggle-slider {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .history-empty {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .history-empty p {
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .history-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .history-item:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .history-item-type {
    color: #1a1a1a;
}

[data-theme="light"] .history-item-time {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .history-item-duration {
    color: rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .history-callback-btn.disabled {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .callback-modal {
    background: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .callback-content {
    background: linear-gradient(145deg, #fff, #f5f5f7);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .callback-content h3 {
    color: #1a1a1a;
}

[data-theme="light"] .callback-content p {
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .callback-reject {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 480px) {
    .history-panel {
        width: 100%;
    }

    .history-header {
        padding: 16px 20px;
    }

    .history-settings {
        padding: 14px 20px;
    }

    .history-list {
        padding: 10px;
    }

    .history-item {
        padding: 12px;
        gap: 10px;
    }

    .history-clear {
        margin: 12px 20px 20px;
    }

    .callback-content {
        padding: 24px;
    }

    .callback-icon {
        font-size: 2.5rem;
    }

    .callback-content h3 {
        font-size: 1.3rem;
    }

    .callback-actions {
        flex-direction: column;
    }
}