:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --msg-sent: #6366f1;
    --msg-received: rgba(51, 65, 85, 0.8);
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --radius-lg: 20px;
    --radius-md: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    background-attachment: fixed;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 500px;
    height: 90vh;
    padding: 20px;
    display: flex;
}

.chat-wrapper {
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: slideIn 0.8s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Header */
.chat-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    position: relative;
    width: 44px;
    height: 44px;
}

.avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #1e293b;
}

.status-indicator.online {
    background: #10b981;
}

.details h1 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
}

.details p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.header-actions button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.header-actions button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ef4444;
}

/* Message List */
.message-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.message-container::-webkit-scrollbar {
    width: 6px;
}

.message-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    position: relative;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: messagePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes messagePop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }

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

.message.sent {
    align-self: flex-end;
    background: var(--msg-sent);
    border-bottom-right-radius: 4px;
    color: white;
}

.message.received {
    align-self: flex-start;
    background: var(--msg-received);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--glass-border);
}

.timestamp {
    display: block;
    font-size: 0.7rem;
    margin-top: 6px;
    opacity: 0.6;
}

.message.system {
    align-self: center;
    background: rgba(255, 255, 255, 0.05) !important;
    border: none !important;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 6px 16px;
    border-radius: 20px;
    margin: 8px 0;
}

.input-area {
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
}

.input-wrapper {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 6px 6px 6px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

#message-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
}

.attachment-btn,
#send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.attachment-btn {
    background: transparent;
    color: var(--text-muted);
}

.attachment-btn:hover {
    color: var(--text-main);
}

#send-btn {
    background: var(--primary);
    color: white;
}

#send-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

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

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 30px;
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalPop {
    to {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content h3 {
    margin-bottom: 12px;
    font-family: var(--font-heading);
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-actions button {
    padding: 10px 24px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    transition: var(--transition);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* Responsiveness */
@media (max-width: 640px) {
    .app-container {
        padding: 0;
        height: 100vh;
    }

    .chat-wrapper {
        border-radius: 0;
        border: none;
    }
}