/* Core Reset */
* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #000;
    font-family: 'Segoe UI', sans-serif;
    overflow: hidden;
    touch-action: manipulation;
}

/* Updated Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 25px 10px;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

nav button {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 14px 26px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    border-radius: 30px;
    transition: 0.3s;
    font-size: 15px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

nav button:hover, nav button:active {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: scale(1.02);
}

/* Background Layers */
.bg-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: -webkit-fill-available;
    overflow: hidden;
}

.background-blurred {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('epstein.jpg') no-repeat center center;
    background-size: cover;
    filter: blur(10px);
    transform: scale(1.1);
}

.dark-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.411);
    z-index: 1;
}

.background-sharp {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('epstein.jpg') no-repeat center center;
    background-size: cover;
    z-index: 2;
    -webkit-mask-image: radial-gradient(circle 250px at -500px -500px, black 0%, transparent 80%);
    mask-image: radial-gradient(circle 250px at -500px -500px, black 0%, transparent 80%);
}

/* UI Elements - Login/Signup Card */
.login-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.login-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    width: 350px;
    text-align: center;
    color: white;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.login-card h2 {
    margin: 0 0 10px;
    font-size: 24px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-card p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 30px;
}

/* Forms - Styling the text fields for Login/Signup */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: white;
    color: black;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

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

.forgot-pw {
    display: block;
    margin-top: 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    transition: 0.2s;
}

.forgot-pw:hover {
    color: white;
}

/* --- Chat Window Logic --- */

.chat-toggle-btn {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 101;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 18px 65px;
    border-radius: 40px;
    cursor: pointer;
    backdrop-filter: blur(15px);
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.chat-container {
    position: fixed;
    right: 30px;
    bottom: 100px;
    width: 380px; 
    height: 600px; 
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.hidden { 
    display: none; 
    opacity: 0;
    transform: translateY(20px);
}

.chat-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column; 
    gap: 15px; 
    justify-content: flex-start; 
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.msg {
    font-size: 17px; 
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.95);
    padding: 5px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block;
    width: 100%;
}

.msg b {
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    font-size: 11px; 
    letter-spacing: 1.5px;
    display: block;
    margin-bottom: 4px;
}

.del-btn {
    float: right;
    background: rgba(255, 60, 60, 0.12);
    border: 1px solid rgba(255, 60, 60, 0.25);
    border-radius: 6px;
    color: rgba(255, 100, 100, 0.7);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 3px 7px;
    margin-left: 8px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    vertical-align: middle;
}

.del-btn:hover {
    background: rgba(255, 60, 60, 0.35);
    border-color: rgba(255, 80, 80, 0.6);
    color: #ff5050;
}

/* Input Area Styling */
.chat-input-area {
    display: flex;
    padding: 15px;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 12px;
    padding: 12px 15px;
    outline: none;
    font-size: 15px;
    transition: 0.3s;
}

.chat-input-area input:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.chat-input-area button {
    background: #fff;
    color: #000;
    border: none;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s;
}

.chat-input-area button:hover {
    background: #ccc;
    transform: scale(1.05);
}

.chat-input-area div {
    position: relative;
    flex: 1;
}

#char-count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    transition: color 0.3s;
}

#char-count.warning {
    color: #ff5050;
    opacity: 0.8;
}

.chat-input-area input {
    padding-right: 60px !important; 
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .chat-container {
        width: calc(100% - 40px);
        right: 20px;
        height: 50vh;
    }
}