:root {
    --bg-color: #f0f2f5;
    --panel-bg: #ffffff;
    --primary-color: #0084ff;
    --text-primary: #1c1e21;
    --text-secondary: #65676b;
    --border-color: #dadce0;
    --msg-sent: #0084ff;
    --msg-received: #f0f0f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.app-header {
    background-color: var(--panel-bg);
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.app-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.emulator-container {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 30px;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.phone-panel {
    background: var(--panel-bg);
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    width: 400px;
    max-width: 100%;
    border: 8px solid #333; /* Simulate phone bezel */
    overflow: hidden;
}

.phone-header {
    background-color: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.phone-header h2 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
}

.user-selector select {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    margin-top: 5px;
}

.phone-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #fff;
}

.screen-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow-y: auto;
}

.screen-state.hidden {
    display: none;
}

/* Specific elements */
textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin: 15px 0;
    resize: none;
    font-family: inherit;
    box-sizing: border-box;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: background 0.2s;
}

button:hover {
    background-color: #006bce;
}

button:disabled {
    background-color: #a0c9f0;
    cursor: not-allowed;
}

.small-btn {
    padding: 5px 10px;
    font-size: 0.8rem;
    background-color: #e4e6eb;
    color: var(--text-primary);
}

.small-btn:hover {
    background-color: #d8dadf;
}

.empty-state {
    color: var(--text-secondary);
    text-align: center;
    margin-top: 20px;
}

/* Pending Requests List */
.request-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background: #fafafa;
}
.request-card p {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
}
.request-card button {
    width: 100%;
}

/* Chat Layout */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}
.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.sent {
    background-color: var(--msg-sent);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.received {
    background-color: var(--msg-received);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    outline: none;
    font-size: 0.95rem;
}

.chat-input-area button {
    border-radius: 20px;
    padding: 10px 20px;
}

/* Simple Loader */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}