/* Customer Chat Panel Styles */
.chat-nav-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.chat-nav-btn:hover {
    background: var(--primary-color);
    color: white;
}

.chat-nav-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.customer-chat-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.chat-panel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.chat-panel-container {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 1000px;
    height: 85%;
    max-height: 700px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.chat-panel-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
}

.chat-panel-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
}

.chat-panel-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.customer-chat-sidebar {
    width: 300px;
    border-right: 1px solid #e5e7eb;
    background: #f8fafc;
}

.customer-chat-list {
    height: 100%;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 0.5rem;
}

.customer-chat-list::-webkit-scrollbar {
    width: 8px;
}

.customer-chat-list::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 6px;
}

.customer-chat-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 6px;
    border: 1px solid #f8fafc;
}

.customer-chat-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
}

.customer-chat-item {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    min-height: 80px;
}

.customer-chat-item:hover {
    background: #e5e7eb;
}

.customer-chat-item.active {
    background: var(--primary-color);
    color: white;
}

.customer-chat-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.customer-chat-product-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.customer-chat-info {
    flex: 1;
}

.customer-chat-product-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.customer-chat-last-msg {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.customer-chat-time {
    font-size: 0.7rem;
    color: #9ca3af;
}

.customer-unread-badge {
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.customer-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.no-chat-selected {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    text-align: center;
}

.no-chat-selected i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.customer-chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.customer-chat-header-img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.customer-chat-header-info h4 {
    margin: 0;
    font-size: 1.1rem;
}

.customer-chat-header-info p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.customer-chat-status {
    margin-left: auto;
    color: #10b981;
    font-size: 0.8rem;
    font-weight: 600;
}

.customer-chat-messages {
    flex: 1;
    padding: 1rem 1rem 100px 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8fafc;
    scroll-behavior: smooth;
    position: relative;
    max-height: 500px;
    min-height: 300px;
}

.customer-chat-messages::-webkit-scrollbar {
    width: 10px;
}

.customer-chat-messages::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 8px;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.1);
}

.customer-chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    border-radius: 8px;
    border: 2px solid #f0fdf4;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.customer-chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5);
    transform: scale(1.05);
}

.customer-chat-form {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.75rem;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    backdrop-filter: blur(10px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 100;
    animation: slideUp 0.3s ease-out;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.customer-chat-form input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    outline: none;
    font-size: 16px;
    min-height: 50px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.customer-chat-form input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1), 0 4px 15px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.customer-chat-form input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.customer-chat-form button {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 50%;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37,99,235,0.4);
}

.customer-chat-form button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(37,99,235,0.6);
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

.customer-chat-form button:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .chat-panel-container {
        width: 95%;
        height: 95%;
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .customer-chat-sidebar {
        width: 280px;
        min-width: 280px;
    }
    
    .customer-chat-list {
        padding: 0.5rem;
    }
    
    .customer-chat-item {
        padding: 0.75rem;
        margin-bottom: 0.25rem;
    }
}

@media (max-width: 640px) {
    .chat-panel-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .chat-panel-content {
        flex-direction: column;
        height: 100%;
    }
    
    .customer-chat-sidebar {
        width: 100%;
        height: 35%;
        max-height: 250px;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        flex-shrink: 0;
    }
    
    .customer-chat-list {
        height: 100%;
        padding: 0.25rem;
    }
    
    .customer-chat-item {
        padding: 0.75rem 0.5rem;
        margin-bottom: 0.25rem;
        min-height: 70px;
    }
    
    .customer-chat-area {
        flex: 1;
        height: 65%;
        display: flex;
        flex-direction: column;
    }
    
    .customer-chat-messages {
        flex: 1;
        min-height: 200px;
        max-height: calc(65vh - 150px);
        padding: 0.75rem 0.75rem 80px 0.75rem;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .customer-chat-form {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    
    .customer-chat-form input {
        padding: 0.875rem;
        font-size: 16px;
        border-radius: 20px;
    }
    
    .customer-chat-form button {
        width: 45px;
        height: 45px;
        padding: 0.75rem;
    }
    
    .customer-chat-messages {
        padding: 0.75rem 0.75rem 90px 0.75rem;
        max-height: calc(100vh - 300px);
        min-height: 250px;
    }
    
    .chat-panel-header {
        padding: 0.75rem 1rem;
        flex-shrink: 0;
    }
    
    .chat-panel-title h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .customer-chat-sidebar {
        height: 30%;
        max-height: 200px;
    }
    
    .customer-chat-area {
        height: 70%;
    }
    
    .customer-chat-item {
        padding: 0.5rem;
        min-height: 60px;
    }
    
    .customer-chat-product-title {
        font-size: 0.85rem;
    }
    
    .customer-chat-last-msg {
        font-size: 0.75rem;
    }
}