/* Basic setup for body */
body {
    background-color: #ECE5DD; /* WhatsApp Background color */
    color: #4A4A4A; /* Font color similar to WhatsApp */
    font-family: 'Roboto', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    box-sizing: border-box;
}

#logo {
    max-width: 150px;
    height: auto;
    display: flex;
    flex-direction: column;
}

/* App container */
.app-container {
    background-color: #FFFFFF; /* WhatsApp chat window color */
    border-radius: 0px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: 100vh;
    width: 100vw;
    max-width: 500px;
    box-sizing: border-box;
}

/* App header */
.app-header {
    background-color: #075E54; /* WhatsApp header color */
    color: #FFFFFF;
    padding: 10px 20px;
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-name {
    font-size: 1.5em;
    margin: 0;
    text-align: center;
}

/* App body */
.app-body {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
    overflow-y: auto;
}

/* Action section */
.action-section, .footer-button-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Language selectors */
.lang-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 60%;
    padding: 10px;
    background-color: #F0F0F0;
    border-radius: 20px;
}

.lang-selector {
    width: 35%;
    padding: 10px;
    font-size: 0.9em;
    color: #4A4A4A;
    border: none;
    border-radius: 5px;
    background-color: #FFFFFF;
    appearance: none;
    outline: none;
}

#modeSelector {
    width: 90%;
    padding: 10px;
    font-weight: bold;
    font-size: 0.9em;
    color: #4A4A4A;
    border: none;
    border-radius: 5px;
    background-color: transparent;
    appearance: none;
    outline: none;
    text-align: center;
}

/* Mode selectors */
.mode-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 120px;
    height: 10%;
    padding: 10px;
    background-color: #F0F0F0;
    border-radius: 20px;
}

/* Arrow styling */
#arrow {
    width: 20px;
    height: 20px;
}

/* Buttons */
.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

#recordButton, #audioButton, #clearButton {
    padding: 10px 20px;
    background-color: #128C7E; /* WhatsApp color for buttons */
    border: none;
    color: #FFFFFF;
    border-radius: 50px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#recordButton:active, #audioButton:active, #clearButton:active {
    background-color: #075E54; /* darker shade for active state */
}

#clearButton {
    background-color: #9E9E9E;
}

#clearButton:active {
    background-color: #757575;
}

/* Pulsing animation while recording */
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(18, 140, 126, 0.6); }
    70%  { box-shadow: 0 0 0 12px rgba(18, 140, 126, 0); }
    100% { box-shadow: 0 0 0 0 rgba(18, 140, 126, 0); }
}

#recordButton.recording {
    background-color: #e53935;
    animation: pulse 1.2s infinite;
}

#recordButton.recording:active {
    background-color: #b71c1c;
}

/* Disabled/loading state */
#recordButton:disabled {
    background-color: #9E9E9E;
    cursor: not-allowed;
    animation: none;
}

/* Translation section */
.output-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Containers for transcript and translation */
.translation-box {
    background-color: #DCF8C6; /* WhatsApp message bubble color */
    border-radius: 5px;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

#transcriptText, #translationText {
    color: #075E54; /* WhatsApp color for text headings */
    font-size: 1.2em;
    font-weight: bold;
    margin: 0;
}

.copy-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 1em;
    color: #075E54;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.copy-button:hover {
    opacity: 1;
}

#transcript, #translation {
    color: #4A4A4A; /* WhatsApp color for text content */
    font-size: 1em;
}

/* Toast notifications */
#toastContainer {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    pointer-events: none;
}

.toast {
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 1;
    transition: opacity 0.4s;
    max-width: 320px;
    text-align: center;
}

.toast-error   { background-color: #e53935; }
.toast-success { background-color: #128C7E; }
.toast-info    { background-color: #616161; }

.toast-fade-out { opacity: 0; }

/* Media queries for responsive design */
@media (max-width: 768px) {
    .lang-selector {
        font-size: 0.8em;
    }

    #recordButton, #audioButton, #clearButton {
        font-size: 0.9em;
    }

    .translation-box {
        font-size: 0.9em;
    }
}
