/* Customer Service Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Screen reader only labels for accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.customer-service-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 4px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    min-height: 45px;
    z-index: 2;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.4rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo i {
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.logo h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(40, 167, 69, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    border: 1px solid rgba(40, 167, 69, 0.3);
    backdrop-filter: blur(10px);
}

.status-indicator span:last-child {
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #28a745;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.status-dot.offline {
    background: #dc3545;
    animation: pulse-offline 1.5s infinite;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

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

@keyframes pulse-offline {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Welcome Screen */
.welcome-screen {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
}

.welcome-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1.5rem;
}

.welcome-content h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #333;
}

.welcome-content p {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.email-form {
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    min-height: 100px;
}

/* Chat Interface */
.chat-interface {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    height: 600px;
    display: flex;
    flex-direction: column;
}

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

.chat-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-info i {
    font-size: 1.5rem;
    color: #667eea;
}

.chat-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.chat-status {
    color: #666;
    font-size: 0.9rem;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 80%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: white;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #667eea;
}

.message.admin .message-avatar {
    background: #28a745;
}

.message.auto-reply .message-avatar {
    background: #ff9500;
}

.message-content {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: 15px;
    position: relative;
}

.message.user .message-content {
    background: #34c759;
    color: white;
}

.message.admin .message-content {
    background: #007aff;
    color: white;
}

.message.auto-reply .message-content {
    background: #ff9500;
    color: white;
    border: 2px solid #ff9500;
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.3);
}

/* Auto-reply indicator animation */
@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.message-text {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
}

.message-image {
    max-width: 200px;
    border-radius: 10px;
    margin-top: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.message-image:hover {
    transform: scale(1.05);
}

/* Chat Input */
.chat-input-container {
    padding: 1rem;
    border-top: 1px solid #e1e5e9;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 0.5rem;
}

.input-group input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem 1rem;
    outline: none;
    font-size: 1rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    color: #667eea;
    border-radius: 50%;
}

.btn-icon:hover {
    background: rgba(102, 126, 234, 0.1);
}

.typing-indicator {
    padding: 0.5rem 1rem;
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

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

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast.info {
    border-left: 4px solid #17a2b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 0.6rem 1rem;
    }
    
    .header-content {
        min-height: 40px;
    }
    
    .back-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .logo {
        padding: 0.3rem 0.8rem;
    }
    
    .logo i {
        font-size: 1.3rem;
    }
    
    .logo h1 {
        font-size: 1rem;
    }
    
    .status-indicator {
        padding: 0.3rem 0.6rem;
    }
    
    .status-indicator span:last-child {
        font-size: 0.75rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .welcome-screen {
        padding: 2rem;
    }
    
    .chat-interface {
        height: 500px;
    }
    
    .message {
        max-width: 90%;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
