/* --- Base Styles --- */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #e0e0e0;
}

/* --- Main Layout Container --- */
.app-container {
    display: flex;
    gap: 40px; /* INCREASED */
    background-color: #2c2c2e;
    padding: 35px; /* INCREASED */
    border-radius: 50px; /* INCREASED */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid #444;
}

/* --- Left Panel: Conversation --- */
.conversation-view {
    width: 400px; /* INCREASED */
    height: 650px; /* INCREASED */
    background-color: #1c1c1e;
    border-radius: 30px; /* INCREASED */
    padding: 25px; /* INCREASED */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
.conversation-view h3 {
    margin-top: 0;
    text-align: center;
    color: #a0a0a0;
    border-bottom: 1px solid #444;
    padding-bottom: 15px; /* INCREASED */
    font-size: 1.5em; /* INCREASED */
}
#conversation-log {
    flex-grow: 1;
    overflow-y: auto;
    font-size: 1.1em; /* INCREASED */
    display: flex;
    flex-direction: column;
    gap: 15px; /* INCREASED */
}

.status-indicator {
    text-align: center;
    padding: 8px; /* INCREASED */
    margin-bottom: 15px; /* INCREASED */
    color: #a0a0a0;
    font-style: italic;
    font-size: 1em; /* INCREASED */
    border-radius: 8px; /* INCREASED */
    background-color: #3a3a3c;
}

/* --- Conversation Bubbles --- */
.log-entry {
    padding: 12px 16px; /* INCREASED */
    border-radius: 22px; /* INCREASED */
    max-width: 85%; /* INCREASED */
    word-wrap: break-word;
    line-height: 1.4; /* ADDED for better readability */
}
.user-message {
    background-color: #007aff;
    color: white;
    align-self: flex-end; /* Aligns to the right */
}
.agent-message {
    background-color: #505052;
    color: white;
    align-self: flex-start; /* Aligns to the left */
}

/* --- Right Panel: Phone & Keypad --- */
.phone { 
    width: 380px; /* INCREASED */
    padding: 20px; 
    box-sizing: border-box; 
}
#display { 
    width: 100%; 
    height: 80px; /* INCREASED */
    font-size: 42px; /* INCREASED */
    text-align: right; 
    border: none; 
    background-color: transparent; 
    color: #fff; 
    padding: 0 10px; 
    box-sizing: border-box; 
    margin-bottom: 30px; /* INCREASED */
}
.keypad { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px; /* INCREASED */
}
.keypad button { 
    width: 90px; /* INCREASED */
    height: 90px; /* INCREASED */
    font-size: 36px; /* INCREASED */
    border: none; 
    border-radius: 50%; 
    cursor: pointer; 
    background-color: #505052; 
    color: #fff; 
    transition: background-color 0.2s; 
    margin: auto; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    padding-top: 5px; 
}
.keypad button .chars { 
    font-size: 12px; /* INCREASED */
    letter-spacing: 1.5px; /* INCREASED */
    margin-top: 4px; /* INCREASED */
    color: #c7c7cc; 
}
.keypad button:hover { background-color: #6a6a6c; }
.keypad button:active { background-color: #8e8e93; }

/* --- Special Buttons --- */
.call-button { background-color: #34c759 !important; color: white; }
.call-button:hover { background-color: #30d158 !important; }

.end-call-button {
    background-color: #ff3b30 !important; /* Red color */
    color: white;
}
.end-call-button:hover { background-color: #ff453a !important; }

.control-button { background-color: transparent !important; }
.control-button:hover { background-color: #6a6a6c !important; }

.flow-state-display {
    text-align: center;
    padding: 10px;
    margin-bottom: 15px;
    background-color: #3a3a3c;
    border-radius: 10px;
    border: 1px solid #555;
}

.flow-state-label {
    color: #a0a0a0;
    font-size: 0.9em;
    margin-right: 8px;
}

#flow-state-text {
    color: #34c759;
    font-weight: bold;
    font-size: 1.1em;
}

/* Terminal state styling */
.flow-state-display.terminal #flow-state-text {
    color: #ff3b30;
}