/* Uganda Airlines Brand Colors */
:root {
    --ua-red: #DC143C;
    --ua-black: #1a1a1a;
    --ua-yellow: #FFD700;
    --ua-white: #ffffff;
    
    /* WhatsApp-style colors */
    --wa-green: #25D366;
    --wa-light-green: #DCF8C6;
    --wa-gray: #E5E5E5;
    --wa-dark-gray: #303030;
    --wa-blue: #34B7F1;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

/* Navbar Styles */
.navbar {
    background: linear-gradient(135deg, var(--ua-black) 0%, var(--ua-red) 100%) !important;
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, var(--ua-red) 0%, var(--ua-black) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 450px;
    width: 100%;
}

.login-header {
    background: linear-gradient(135deg, var(--ua-black) 0%, var(--ua-red) 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
}

.logo-placeholder {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--ua-yellow);
    font-size: 14px;
    font-weight: bold;
    color: var(--ua-black);
}

.company-name {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.company-tagline {
    font-size: 14px;
    color: var(--ua-yellow);
    margin-bottom: 0;
}

.login-body {
    padding: 40px 30px;
}

.login-title {
    color: var(--ua-black);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

.login-subtitle {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 30px;
    text-align: center;
}

.form-label {
    color: var(--ua-black);
    font-weight: 500;
    margin-bottom: 8px;
}

.form-control {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 15px;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--ua-red);
    box-shadow: 0 0 0 0.2rem rgba(220, 20, 60, 0.15);
}

.btn-login {
    background: linear-gradient(135deg, var(--ua-red) 0%, var(--ua-black) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    margin-top: 20px;
    transition: transform 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 20, 60, 0.3);
}

.alert {
    border-radius: 10px;
    border: none;
    margin-bottom: 20px;
}

.login-footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 13px;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
}

.input-group-custom {
    position: relative;
}

/* Button Styles */
.btn-primary {
    background: var(--ua-red);
    border-color: var(--ua-red);
}

.btn-primary:hover {
    background: #b8112e;
    border-color: #b8112e;
}

.btn-outline-primary {
    color: var(--ua-red);
    border-color: var(--ua-red);
}

.btn-outline-primary:hover {
    background: var(--ua-red);
    border-color: var(--ua-red);
}

/* Badge Styles */
.badge.bg-primary {
    background-color: var(--ua-red) !important;
}

/* ============================================ */
/* Toast/Alert Messages */
/* ============================================ */

.toast-container {
    z-index: 9999 !important;
}

.toast {
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.bg-success {
    background-color: #198754 !important;
}

.toast.bg-error,
.toast.bg-danger {
    background-color: #dc3545 !important;
}

.toast.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.toast.bg-warning .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.toast.bg-info {
    background-color: #0dcaf0 !important;
    color: #000 !important;
}

.toast.bg-info .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.toast-body {
    padding: 0.75rem;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.toast-body i {
    font-size: 1.2rem;
}

/* ============================================ */
/* WhatsApp-Style Chat Interface */
/* ============================================ */

/* Chat Container Layout */
.container-fluid.h-100 {
    height: calc(100vh - 60px);
    padding: 0;
}

.row.h-100 {
    height: 100%;
    margin: 0;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, var(--ua-black) 0%, var(--ua-red) 100%);
    color: white;
    padding: 15px 20px;
    border-bottom: 2px solid var(--ua-yellow);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chat-avatar {
    font-size: 2.5rem;
    margin-right: 15px;
    color: var(--ua-yellow);
}

.chat-header h5 {
    color: white;
    font-weight: 600;
    margin: 0;
}

.chat-header .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.875rem;
}

.chat-actions .btn {
    border-radius: 20px;
    font-size: 0.875rem;
    padding: 0.375rem 1rem;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h100v100H0z' fill='%23e5ddd5'/%3E%3Cpath d='M0 0l50 50M50 0l50 50M0 50l50 50' stroke='%23d4ccc4' stroke-width='0.5' fill='none'/%3E%3C/svg%3E");
    height: calc(100vh - 250px);
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
}

/* Message Wrapper */
.message-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    max-width: 65%;
    animation: slideIn 0.3s ease-out;
    clear: both;
}

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

.message-left {
    align-self: flex-start;
    align-items: flex-start;
    margin-right: auto;
}

.message-right {
    align-self: flex-end;
    align-items: flex-end;
    margin-left: auto;
}

/* Message Bubble */
.message-bubble {
    padding: 8px 12px;
    border-radius: 7.5px;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    max-width: 100%;
}

.message-received {
    background-color: white;
    border-bottom-left-radius: 0;
}

.message-sent {
    background-color: var(--wa-light-green);
    border-bottom-right-radius: 0;
}

.message-content p {
    margin: 0;
    color: #303030;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Message Meta (time and status) */
.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 4px;
    gap: 4px;
}

.message-time {
    font-size: 11px;
    color: #667781;
}

.message-status {
    font-size: 14px;
    line-height: 1;
}

.message-status .text-primary {
    color: #34B7F1 !important;
}

.message-sender {
    font-size: 11px;
    color: #667781;
    margin-top: 4px;
    padding: 0 5px;
    font-weight: 500;
}

/* Chat Input */
.chat-input {
    background-color: #f0f0f0;
    padding: 10px 20px;
    border-top: 1px solid #ddd;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.chat-textarea {
    border-radius: 20px;
    border: 1px solid #ddd;
    padding: 10px 15px;
    resize: none;
    min-height: 45px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.3s ease;
}

.chat-textarea:focus {
    outline: none;
    border-color: var(--ua-red);
    box-shadow: 0 0 0 0.2rem rgba(220, 20, 60, 0.15);
}

.btn-send {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ua-red) 0%, var(--ua-black) 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.4);
}

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

/* Empty State */
.chat-messages .text-center.text-muted {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #667781;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

.chat-textarea::-webkit-scrollbar {
    width: 4px;
}

.chat-textarea::-webkit-scrollbar-track {
    background: transparent;
}

.chat-textarea::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .message-wrapper {
        max-width: 85%;
    }
    
    .chat-header h5 {
        font-size: 1rem;
    }
    
    .chat-actions .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .chat-avatar {
        font-size: 2rem;
        margin-right: 10px;
    }
    
    .chat-messages {
        padding: 15px;
        height: calc(100vh - 280px);
    }
}

@media (max-width: 576px) {
    .message-wrapper {
        max-width: 90%;
    }
    
    .chat-header {
        padding: 12px 15px;
    }
    
    .chat-input {
        padding: 8px 15px;
    }
    
    .btn-send {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

/* Conversation list real-time updates */

/* Flash animation when conversation updates */
.conversation-updated {
    animation: flash 0.5s ease-in-out;
}

@keyframes flash {
    0%, 100% { 
        background-color: transparent; 
    }
    50% { 
        background-color: #e3f2fd; 
    }
}

/* Unread badge */
.unread-badge {
    display: inline-block;
    background-color: #25D366;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 8px;
    min-width: 20px;
    text-align: center;
}

/* WebSocket status indicator */
.ws-status {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px white, 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.ws-status-connected { 
    background-color: #4caf50; 
}

.ws-status-disconnected { 
    background-color: #f44336; 
    animation: pulse 2s infinite;
}

.ws-status-error { 
    background-color: #ff9800; 
}

.ws-status-failed { 
    background-color: #9e9e9e; 
}

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

/* Conversation item styles */
.conversation-item {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.conversation-item:hover {
    background-color: #f5f5f5;
}

/* Media indicators */
.media-indicator {
    margin-right: 4px;
    color: #666;
}

