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

:root {
    --blur-amount: 10px;
    --border-radius: 15px;
    --glow-color: rgba(255, 255, 255, 0.3);
    --message-bubble-color: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.2);
}

html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #1a2a6c, #2a4858, #141E30);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: white;
}

.app-container {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-container {
    flex: 1;
    margin: 0 2rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 24px var(--shadow-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.message {
    display: flex;
    align-items: flex-start;
    margin: 0 0;
    gap: 0.5rem;
}

.profile-picture {
    width: 40px;
    height: 40px;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    border-radius: 5px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px var(--shadow-color);
    background: rgba(255, 255, 255, 0.1);
}

.message-bubble {
    background: var(--message-bubble-color);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    padding: 0.75rem;
    border-radius: 0 var(--border-radius) var(--border-radius) var(--border-radius);
    flex-grow: 1;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 12px var(--shadow-color);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.username {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    text-shadow: 0 2px 4px var(--shadow-color);
}

.timestamp {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.message-content {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.message-form {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 24px var(--shadow-color);
    margin-top: auto;
}

.message-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.8rem 1rem;
    color: white;
    font-size: 1rem;
    resize: vertical;
    min-height: 1.5rem;
    max-height: 150px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.message-input:hover, .message-input:focus {
    border-color: var(--glow-color);
    box-shadow: 0 0 15px var(--glow-color);
    outline: none;
}

.send-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.8rem 1.5rem;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.send-button:hover {
    border-color: var(--glow-color);
    box-shadow: 0 0 15px var(--glow-color);
    background: rgba(255, 255, 255, 0.2);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border: none;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 24px var(--shadow-color);
    margin: 0;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px var(--shadow-color);
}

/* Login styles */
.login-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 24px var(--shadow-color);
}

.login-title {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    color: white;
    text-shadow: 0 2px 4px var(--shadow-color);
    margin-bottom: 1rem;
}

.login-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.8rem 1rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.login-input:hover, .login-input:focus {
    border-color: var(--glow-color);
    box-shadow: 0 0 15px var(--glow-color);
    outline: none;
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.login-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.8rem 1.5rem;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
    text-align: center;
    text-decoration: none;
}

.login-button:hover {
    border-color: var(--glow-color);
    box-shadow: 0 0 15px var(--glow-color);
    background: rgba(255, 255, 255, 0.2);
}

.login-text {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin: 0.5rem 0;
}

.login-link {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.login-link:hover {
    text-shadow: 0 0 10px var(--glow-color);
}

.login-error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: var(--border-radius);
    padding: 0.8rem 1.5rem;
    color: white;
    font-size: 1rem;
    text-align: center;
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    box-shadow: 0 2px 8px var(--shadow-color);
}

/* Custom scrollbar */
.messages-container::-webkit-scrollbar {
    width: 8px;
}

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

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
