/* WhatsApp-style Chat Interface */

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

:root {
    --primary-color: #075E54;
    --secondary-color: #128C7E;
    --accent-color: #25D366;
    --user-message-bg: #DCF8C6;
    --admin-message-bg: #FFFFFF;
    --background: #ECE5DD;
    --header-bg: #075E54;
    --input-bg: #F0F0F0;
    --text-primary: #000000;
    --text-secondary: #667781;
    --border-color: #D1D7DB;
    --online-color: #25D366;
    --offline-color: #999999;
    --typing-color: #667781;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--background);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d9d9d9' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.chat-container {
    max-width: 100%;
    height: 100vh;
    margin: 0 auto;
    background: var(--background);
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Chat Header */
.chat-header {
    background: var(--header-bg);
    color: white;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.admin-info h2 {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
}

.status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--offline-color);
    display: inline-block;
}

.status-dot.online {
    background: var(--online-color);
    box-shadow: 0 0 6px var(--online-color);
}

.status-dot.typing {
    background: var(--accent-color);
    animation: pulse 1.5s infinite;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.social-icons {
    display: flex;
    gap: 12px;
}

.social-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    transition: transform 0.2s, opacity 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.social-icon:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.social-icon.whatsapp {
    background: #25D366;
}

.social-icon.instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}

.social-icon.facebook {
    background: #1877F2;
}

.social-icon.twitter {
    background: #1DA1F2;
}

.social-icon.linkedin {
    background: #0A66C2;
}

.social-icon.youtube {
    background: #FF0000;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

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

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

.date-divider {
    text-align: center;
    margin: 12px 0;
    position: relative;
}

.date-divider span {
    background: rgba(225, 245, 254, 0.92);
    padding: 6px 12px;
    border-radius: 7.5px;
    font-size: 12.5px;
    color: #54656f;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.message {
    display: flex;
    margin-bottom: 8px;
    animation: messageSlide 0.3s ease-out;
}

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

.message.user {
    justify-content: flex-end;
}

.message.admin {
    justify-content: flex-start;
}

.message-content {
    max-width: 65%;
    padding: 6px 7px 8px 9px;
    border-radius: 7.5px;
    position: relative;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    word-wrap: break-word;
}

.message.user .message-content {
    background: var(--user-message-bg);
    border-top-right-radius: 0;
}

.message.admin .message-content {
    background: var(--admin-message-bg);
    border-top-left-radius: 0;
}

.message-text {
    font-size: 14.2px;
    line-height: 19px;
    color: #111b21;
    margin: 0 0 4px 0;
    white-space: pre-wrap;
}

.message-time {
    font-size: 11px;
    color: #667781;
    text-align: right;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
}

.message-status {
    font-size: 16px;
    color: #667781;
}

.message-status.read {
    color: #53bdeb;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 10px;
}

.typing-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.typing-dots {
    background: white;
    padding: 16px 12px 12px;
    border-radius: 7.5px;
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667781;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    background: var(--background);
    padding: 10px 16px 10px;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 21px;
    padding: 5px 15px;
    gap: 8px;
}

.emoji-button {
    background: none;
    border: none;
    font-size: 24px;
    color: #667781;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.emoji-button:hover {
    color: var(--secondary-color);
}

.message-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    padding: 9px 0;
    background: transparent;
    color: var(--text-primary);
}

.message-input::placeholder {
    color: #667781;
}

.send-button {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    transition: transform 0.2s, color 0.2s;
}

.send-button:hover {
    transform: scale(1.1);
    color: var(--primary-color);
}

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

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    bottom: 75px;
    left: 16px;
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-width: 320px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-grid::-webkit-scrollbar {
    width: 6px;
}

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

.emoji-grid span {
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.emoji-grid span:hover {
    background: var(--input-bg);
}

/* Blocked Overlay */
.blocked-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.blocked-message {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
}

.blocked-message i {
    font-size: 64px;
    color: #e74c3c;
    margin-bottom: 20px;
}

.blocked-message h3 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.blocked-message p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Notification Modal */
.notification-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.notification-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    animation: modalSlide 0.3s ease-out;
}

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

.notification-content i {
    font-size: 48px;
    color: var(--secondary-color);
    margin-bottom: 16px;
}

.notification-content h3 {
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.notification-content p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.notification-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: var(--input-bg);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Responsive Design */
@media (min-width: 768px) {
    .chat-container {
        max-width: 900px;
        height: 95vh;
        margin: 2.5vh auto;
        border-radius: 8px;
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .message-content {
        max-width: 80%;
    }
    
    .social-icons {
        gap: 8px;
    }
    
    .social-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .emoji-picker {
        max-width: calc(100vw - 32px);
    }
    
    .emoji-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

/* Welcome Message */
.welcome-message {
    background: #fff4ce;
    padding: 12px 16px;
    border-radius: 7.5px;
    margin: 20px auto;
    max-width: 80%;
    text-align: center;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.welcome-message p {
    font-size: 14px;
    color: #667781;
    margin: 0;
    line-height: 1.5;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

