/* css/style.css */
:root {
    --primary-color: #FEE500;
    /* Kakao-like Yellow */
    --primary-text: #3c1e1e;
    --bg-color: #b2c7da;
    /* Light Blue Chat BG */
    --white: #ffffff;
    --gray-light: #f2f2f2;
    --gray-dark: #888;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f7f7f7;
    color: #333;
}

.app-container {
    max-width: 600px;
    /* Mobile width limit */
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background-color: var(--white);
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    font-size: 1.1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Content */
.app-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--primary-text);
}

.btn-secondary {
    background-color: var(--gray-light);
    color: #333;
    border: 1px solid #ddd;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--gray-dark);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

/* Chat Layout */
.chat-window {
    background-color: var(--bg-color);
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    /* align-items: stretch;  Default is stretch, but if it was center/start, align-self would be needed. */
    overflow-y: auto;
    padding-bottom: 70px;
    /* Space for input bar */
}

.message {
    max-width: 70%;
    margin-bottom: 10px;
    position: relative;
    /* clear: both; Removed for flex */
}

.message.sent {
    align-self: flex-end;
    /* Right align for me */
    text-align: right;
    /* Text align inside container */
}

.message.received {
    align-self: flex-start;
    /* Left align for others */
    text-align: left;
}

.message-bubble {
    padding: 10px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
}

.message.sent .message-bubble {
    background-color: #dcf8c6;
    /* Light Green for Unread */
    color: #333;
    border-top-right-radius: 2px;
    text-align: left;
}

/* Read Message Style */
.message.sent.read .message-bubble {
    background-color: var(--primary-color);
    /* Yellow for Read */
    color: var(--primary-text);
    border: none;
}

.message.received .message-bubble {
    background-color: var(--white);
    color: #333;
    border-top-left-radius: 2px;
    text-align: left;
}

.message-info {
    font-size: 0.75rem;
    color: #666;
    margin-top: 2px;
    display: flex;
    align-items: flex-end;
}

.message.sent .message-info {
    flex-direction: row-reverse;
    justify-content: flex-start;
    /* Since it's right aligned container */
}

.unread-mark {
    color: #fce100;
    /* Yellow */
    color: #eec900;
    /* Darker Yellow or simpler color */
    color: #ffcc00;
    font-weight: bold;
    margin: 0 4px;
    color: #d4a000;
}

/* Translations */
.translation {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.original {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
}

.translation-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-retranslate {
    background: none;
    border: none;
    color: #999;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.btn-retranslate:hover {
    color: #555;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Chat Input */
.chat-input-area {
    position: fixed;
    bottom: 0;
    max-width: 600px;
    width: 100%;
    background: #fff;
    padding: 10px;
    box-sizing: border-box;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
}

.chat-input-area input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    margin-right: 10px;
}

.btn-send {
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* Loading */
.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #555;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}