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

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

.container-fluid {
    padding: 0;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.header h1 {
    color: #667eea;
    font-size: 2rem;
    font-weight: 700;
}

.header h1 i {
    margin-right: 0.5rem;
}

.header .text-muted {
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Connection Status */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: #f8f9fa;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.connection-status i {
    font-size: 0.7rem;
}

.connection-status.connected {
    background: #d4edda;
    color: #155724;
}

.connection-status.connected i {
    color: #28a745;
    animation: pulse 2s infinite;
}

.connection-status.disconnected {
    background: #f8d7da;
    color: #721c24;
}

.connection-status.disconnected i {
    color: #dc3545;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Content Wrapper */
.content-wrapper {
    padding: 0 2rem 2rem;
    min-height: calc(100vh - 200px);
}

/* Welcome Card */
.welcome-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.5s ease;
}

.welcome-card i {
    color: #667eea;
    opacity: 0.5;
}

.welcome-card h3 {
    color: #667eea;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Messages Container */
.messages-container {
    display: none;
}

.messages-container.has-messages {
    display: block;
}

/* Message Card */
.message-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.5s ease;
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.message-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.sender-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sender-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.sender-details h5 {
    margin: 0;
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

.sender-details p {
    margin: 0;
    font-size: 0.85rem;
    color: #6c757d;
}

.message-time {
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

.message-body {
    margin-top: 1rem;
}

.message-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    word-wrap: break-word;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    text-align: center;
    color: white;
    margin-top: 2rem;
}

.footer i {
    margin-right: 0.5rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

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

/* New Message Indicator */
.message-card.new-message {
    animation: slideIn 0.5s ease, highlight 2s ease;
}

@keyframes highlight {

    0%,
    100% {
        background: rgba(255, 255, 255, 0.95);
    }

    50% {
        background: rgba(102, 126, 234, 0.1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .content-wrapper {
        padding: 0 1rem 1rem;
    }

    .message-card {
        padding: 1rem;
    }

    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .message-time {
        width: 100%;
        justify-content: flex-start;
    }

    .connection-status {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}