/* assets/style.css */
:root {
    --bg-color: #0f0c29;
    --bg-gradient: linear-gradient(315deg, #0f0c29 0%, #302b63 74%, #24243e 100%);
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --primary: #8e2de2;
    --primary-gradient: linear-gradient(to right, #4a00e0, #8e2de2);
    --msg-me-bg: rgba(74, 0, 224, 0.6);
    --msg-other-bg: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: var(--bg-color);
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* For glass effect background fixed */
}

a { text-decoration: none; color: inherit; }

/* Container */
.container {
    width: 100%;
    max-width: 900px; /* Wider for chat */
    padding: 20px;
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 40px;
    text-align: center;
}

/* Forms & Inputs */
input[type="text"], input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    margin: 10px 0;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
    width: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(142, 45, 226, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: linear-gradient(to right, #cb2d3e, #ef473a);
}

/* Chat Room Specifics */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 80vh;
}

.chat-header {
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.message {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 12px;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-sender {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.8;
}

.message.me {
    align-self: flex-end;
    background: var(--msg-me-bg);
    border-bottom-right-radius: 2px;
}

.message.other {
    align-self: flex-start;
    background: var(--msg-other-bg);
    border-bottom-left-radius: 2px;
}

.timestamp {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    display: block;
    margin-top: 5px;
    text-align: right;
}

.chat-input-area {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--card-border);
    padding-top: 15px;
}

.chat-input-area input {
    margin: 0;
    flex: 1;
}

.chat-input-area button {
    width: auto;
    margin: 0;
    padding: 0 25px;
}

.chat-input-area button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.chat-input-area input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Media attachments */
.attachment {
    margin-top: 8px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

.attachment img {
    max-width: 100%;
    max-height: 400px;
    display: block;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.attachment img:hover {
    transform: scale(1.02);
}

.attachment video {
    max-width: 100%;
    max-height: 400px;
    display: block;
    border-radius: 8px;
}

.attachment-name {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    word-break: break-all;
}

.attachment {
    margin-top: 8px;
}

.attachment img,
.attachment video {
    max-width: 260px;
    border-radius: 10px;
    display: block;
}

.attachment-name {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
}

.chat-input-area button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.chat-input-area input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* Utility */
.logo {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-sm {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.error-message {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
