﻿
:root {
    --primary-color: #075e54;
    --secondary-color: #6c757d;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-bg: #e5ddd5;
    --light-text: #212529;
    --light-border: #dee2e6;
    --light-card: #ffffff;
    --sent-bg: #dcf8c6;
    --received-bg: #f0f0f0;
    --menu-bg: #ffffff;
    --menu-hover: #f8f9fa;
    --reaction-bg: #ffffff;
    --reaction-border: #dadada;
    --link-color: #039be5;
}

body.dark-mode {
    --light-bg: #0f0f10;
    --light-text: #f8f9fa;
    --light-border: #495057;
    --light-card: #1c1c1e;
    --sent-bg: #056162;
    --received-bg: #2a2a2c;
    --menu-bg: #2c2c2e;
    --menu-hover: #3a3a3c;
    --reaction-bg: #3a3a3c;
    --reaction-border: #555;
    --link-color: #64b5f6;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0;
    background-color: var(--light-bg);
    color: var(--light-text);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 1rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.logo {
    width: 48px;
}

/* BACK BUTTON STYLE */
#back-to-lobby-btn {
    background-color: var(--secondary-color);
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card {
    padding: 1.5rem;
    background-color: var(--light-card);
    border: 1px solid var(--light-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--light-border);
    border-radius: 4px;
    background-color: var(--light-card);
    color: var(--light-text);
    font-size: 1rem;
    margin-bottom: 1rem;
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: opacity 0.2s;
    width: 100%;
}

    button:hover {
        opacity: 0.9;
    }

    button.danger {
        background-color: var(--danger-color);
    }

    button.secondary {
        background-color: var(--secondary-color);
    }

.icon-btn {
    background: transparent;
    padding: 0.5rem;
    border-radius: 50%;
    display: inline-flex;
    width: auto;
    cursor: pointer;
}

    .icon-btn svg {
        width: 24px;
        height: 24px;
        stroke: var(--light-text);
    }

/* LOBBY STYLES */
.chat-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--light-border);
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: var(--menu-bg);
    cursor: pointer;
    transition: transform 0.1s;
}

    .chat-list-item:hover {
        transform: scale(1.01);
        border-color: var(--primary-color);
    }

/* CHAT STYLES */
#chat-app {
    display: none;
    flex-direction: column;
    height: 80vh;
    max-height: 800px;
}

#chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light-border);
}

.header-info {
    display: flex;
    flex-direction: column;
}

/* TIMER STYLES */
.expiry-timer {
    font-family: monospace;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--received-bg);
    color: var(--primary-color);
    display: inline-block;
    margin-top: 4px;
}

    .expiry-timer.warning {
        color: #d68e00;
    }

    .expiry-timer.critical {
        color: var(--danger-color);
        animation: pulse 2s infinite;
    }

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-messages-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
}

.messages-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0 10px;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
    position: relative;
    cursor: pointer;
}

    .message-bubble.sent {
        background-color: var(--sent-bg);
        align-self: flex-end;
        border-top-right-radius: 0;
    }

    .message-bubble.received {
        background-color: var(--received-bg);
        align-self: flex-start;
        border-top-left-radius: 0;
    }

    .message-bubble a {
        color: var(--link-color);
        text-decoration: underline;
    }

.message-meta {
    font-size: 0.7rem;
    color: var(--secondary-color);
    margin-bottom: 2px;
    font-weight: 600;
}

.message-time {
    font-size: 0.65rem;
    color: var(--secondary-color);
    float: right;
    margin-top: 5px;
    margin-left: 10px;
}

/* REACTION PILLS */
.reaction-container {
    position: absolute;
    bottom: -10px;
    display: flex;
    gap: 2px;
    z-index: 1;
}

.message-bubble.sent .reaction-container {
    right: 10px;
}

.message-bubble.received .reaction-container {
    left: 10px;
}

.reaction-pill {
    background-color: var(--reaction-bg);
    border: 1px solid var(--reaction-border);
    border-radius: 10px;
    padding: 2px 5px;
    font-size: 0.75rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 2px;
}

#chat-form {
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--light-border);
    padding-top: 1rem;
}

    #chat-form input {
        margin-bottom: 0;
    }

    #chat-form button {
        width: auto;
    }

.status-indicator {
    font-size: 0.85rem;
    color: var(--secondary-color);
    text-align: center;
    margin-top: 0.5rem;
}

/* BURGER MENU */
.burger-menu-container {
    position: relative;
}

.menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--menu-bg);
    border: 1px solid var(--light-border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 100;
    flex-direction: column;
}

    .menu-dropdown.show {
        display: flex;
    }

.menu-item {
    padding: 10px 15px;
    color: var(--light-text);
    text-align: left;
    border: none;
    background: none;
    border-bottom: 1px solid var(--light-border);
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
    text-decoration: none;
    display: block;
}

    .menu-item:hover {
        background-color: var(--menu-hover);
    }

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: var(--light-card);
    padding: 2rem;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* MESSAGE OPTIONS MENU */
#message-options-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.message-options-bar {
    background: var(--light-card);
    padding: 15px;
    border-radius: 50px;
    display: flex;
    gap: 15px;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: popIn 0.2s ease-out;
}

.emoji-opt {
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.1s;
    background: none;
    border: none;
    padding: 0;
}

    .emoji-opt:hover {
        transform: scale(1.3);
    }

.delete-opt-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 10px;
    padding: 0;
}

    .delete-opt-btn svg {
        width: 18px;
        height: 18px;
    }

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

