/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000;
    color: #fff;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Welcome/Login Page */
.container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.welcome-section h1 {
    text-align: center;
    color: #fff;
    margin-bottom: 20px;
    font-size: 2.5em;
    font-weight: 700;
}

.welcome-section p {
    text-align: center;
    color: #ccc;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #ccc;
    font-size: 14px;
}

.form-group input {
    padding: 15px 20px;
    border: 2px solid #555;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #222;
    color: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: #666;
    background: #333;
    box-shadow: 0 0 0 3px rgba(102, 102, 102, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #555, #666);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(85, 85, 85, 0.3);
}

.error-message {
    color: #e74c3c;
    background: #2c1818;
    border: 1px solid #e74c3c;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
}

/* Chat Interface */
.page-title {
    background-color: #111;
    color: white;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #333;
}

.page-title h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.app-container {
    display: flex;
    height: calc(100vh - 60px);
    background-color: #000;
}

.sidebar {
    width: 300px;
    background-color: #111;
    border-right: 1px solid #333;
    padding: 20px;
    overflow-y: auto;
}

.sidebar h2 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.sidebar button {
    width: 100%;
    padding: 12px 16px;
    background-color: #555;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.sidebar button:hover {
    background-color: #666;
    transform: translateY(-1px);
}

#chat-history {
    list-style: none;
    padding: 0;
}

#chat-history li {
    padding: 12px 16px;
    margin-bottom: 8px;
    background-color: #222;
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #fff;
}

#chat-history li:hover {
    background-color: #333;
    transform: translateX(2px);
}

#chat-history li.active {
    background-color: #444;
    color: white;
    border-color: #555;
}

.main-chat {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #000;
    position: relative;
}

.chat-header {
    padding: 20px 30px;
    border-bottom: 1px solid #333;
    background-color: #111;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    color: #ccc;
    display: none;
}

.menu-toggle:hover {
    background-color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-weight: 500;
    color: #ccc;
}

#logout-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#logout-button:hover {
    background-color: #c0392b;
}

#chat-messages {
    flex: 1;
    padding: 30px;
    padding-bottom: 100px;
    overflow-y: auto;
    background-color: #111;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    max-width: 70%;
    line-height: 1.6;
    font-size: 16px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user {
    align-self: flex-end;
    background-color: #333;
    color: white;
    padding: 15px 20px;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 2px 10px rgba(51, 51, 51, 0.2);
}

.bot {
    align-self: flex-start;
    background-color: #222;
    color: #fff;
    padding: 15px 20px;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#chat-input {
    padding: 20px 30px;
    background-color: #111;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 15px;
    position: fixed;
    bottom: 0;
    left: 300px;
    right: 0;
    z-index: 10;
}

#message-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #555;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background-color: #222;
    color: #fff;
}

#message-input:focus {
    border-color: #666;
    background-color: #333;
    box-shadow: 0 0 0 3px rgba(102, 102, 102, 0.1);
}

#send-button {
    width: 50px;
    height: 50px;
    background-color: #555;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#send-button:hover {
    transform: scale(1.05);
    background-color: #666;
    box-shadow: 0 4px 15px rgba(85, 85, 85, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 300px;
        height: 100vh;
        background-color: #111;
        border-right: 1px solid #333;
        padding: 20px;
        overflow-y: auto;
        z-index: 1100;
        transition: left 0.3s ease;
    }

    .sidebar.show {
        left: 0;
    }

    .chat-header {
        padding: 15px 20px;
    }

    .chat-header h1 {
        font-size: 18px;
    }

    .header-right {
        position: relative;
    }

    .menu-toggle {
        display: block;
    }

    .user-info {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background-color: #222;
        border: 1px solid #333;
        border-radius: 8px;
        padding: 15px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
        z-index: 1000;
        flex-direction: column;
        gap: 15px;
        min-width: 180px;
    }

    .user-info.show {
        display: flex;
    }

    #chat-messages {
        padding: 20px;
        padding-bottom: 100px;
    }

    .message {
        max-width: 85%;
        font-size: 15px;
    }

    #chat-input {
        padding: 15px 20px;
        left: 0;
        right: 0;
        bottom: 0;
    }

    #message-input {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 20px;
        padding: 20px;
    }

    .welcome-section h1 {
        font-size: 2em;
    }

    .sidebar {
        padding: 10px;
    }

    .chat-header {
        padding: 12px 15px;
    }

    #chat-messages {
        padding: 15px;
        padding-bottom: 80px;
    }

    .message {
        max-width: 95%;
        font-size: 14px;
    }

    #chat-input {
        padding: 12px 15px;
    }
}
