/* Unselectable for all except conversation text */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.message {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Base styles */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.5s ease, color 0.5s ease;
}
body.light-mode {
    background-color: #f2f2f2;
    color: #333;
}

/* Header styling */
.header {
    background-color: #222; /* Dark background */
    color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
}
.site-title {
    margin: 0;
    font-size: 20px;
}

/* Top buttons container */
.top-buttons {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    margin-bottom: 10px;
}

/* Theme Toggle button styling */
.theme-button {
    padding: 10px 15px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    background-color: #333;
    color: #e0e0e0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.theme-button:hover {
    background-color: #444;
}
body.light-mode .theme-button {
    background-color: #ddd;
    color: #333;
}

/* Delete Data button (red colored) */
.delete-button {
    padding: 10px 15px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    background-color: #d9534f;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.delete-button:hover {
    background-color: #c9302c;
}

/* Chat container */
.chat-container {
    flex-grow: 1;
    margin: 10px auto;
    max-width: 600px;
    width: 100%;
    padding: 20px;
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    transition: background-color 0.5s ease, border-color 0.5s ease;
}
body.light-mode .chat-container {
    background-color: #fff;
    border: 1px solid #ccc;
}

/* Chat window */
.chat-window {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    border-bottom: 1px solid #333;
    display: flex;
    flex-direction: column;
}
body.light-mode .chat-window {
    border-bottom: 1px solid #ccc;
}
.message {
    margin: 8px 0;
    padding: 10px 14px;
    border-radius: 16px;
    max-width: 80%;
    word-wrap: break-word;
}
.message.user {
    background-color: #323232;
    align-self: flex-end;
}
.message.bot {
    background-color: #444;
    align-self: flex-start;
}
body.light-mode .message.user {
    background-color: #e6e6e6;
    color: #333;
}
body.light-mode .message.bot {
    background-color: #f0f0f0;
    color: #333;
}

/* Chat input */
.chat-input {
    display: flex;
    margin-top: 10px;
}
.chat-input input {
    flex-grow: 1;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #333;
    border-radius: 4px;
    background-color: #1e1e1e;
    color: #e0e0e0;
}
body.light-mode .chat-input input {
    background-color: #fff;
    border: 1px solid #ccc;
    color: #333;
}
.chat-input button {
    margin-left: 10px;
    padding: 12px 15px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    background-color: #333;
    color: #e0e0e0;
    cursor: pointer;
}
body.light-mode .chat-input button {
    background-color: #ddd;
    color: #333;
}

/* Modal styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.modal.show {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background-color: #222;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    max-width: 300px;
    width: 90%;
    transition: background-color 0.5s ease, color 0.5s ease;
}
body.light-mode .modal-content {
    background-color: #fff;
    color: #333;
}
.modal-content button {
    margin: 5px;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background-color: #555;
    color: #e0e0e0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.modal-content button:hover {
    background-color: #777;
}

/* PIN display */
#pin-display {
    margin: 10px 0;
    font-size: 24px;
    letter-spacing: 4px;
    text-align: center;
}

/* Keypad styling */
#keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 10px auto;
    max-width: 300px;
}
.key {
    padding: 15px;
    font-size: 18px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #444;
    color: #e0e0e0;
    transition: background-color 0.2s ease;
    text-align: center;
    width: 100%; /* Ensure all keys have the same width */
}
body.light-mode .key {
    background-color: #ccc;
    color: #333;
}
.key:hover {
    background-color: #555;
}
/* Ensure the row holding "0" is centered and matches other keys */
.key-row {
    grid-column: 1 / span 3;
    display: flex;
    justify-content: center;
}
.key-row .key {
    width: 100%; /* Match the width of other keys */
}

/* Disclaimer styling */
#disclaimer {
    text-align: center;
    font-size: 12px;
    color: gray;
    margin: 10px;
    padding: 5px;
}

/* Responsive rules for phone/tablet support */
@media (max-width: 600px) {
    .chat-container {
        max-width: 100%;
        height: 90vh;
        padding: 10px;
    }
    .top-buttons button {
        font-size: 14px;
        padding: 8px 12px;
    }
    .chat-input input, .chat-input button {
        font-size: 14px;
        padding: 8px;
    }
    .modal-content {
        max-width: 90%;
        font-size: 14px;
    }
    .key {
        padding: 12px;
        font-size: 16px;
    }
}