/* style.css - Anocha Premium UI */
:root {
    --primary-blue: #007bff;
    --light-blue: #e3f2fd;
    --dark-gray: #343a40;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
    --white: #ffffff;
    --danger: #dc3545;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-gray);
    margin: 0;
    height: 100dvh; /* Dynamic viewport height for mobile */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--dark-gray);
}

/* Header */
header {
    background-color: var(--white);
    padding: 10px 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    height: 50px;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-blue);
    letter-spacing: 0.5px;
}

/* Main Chat Area */
#chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: var(--white);
    scroll-behavior: smooth;
    position: relative;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    border-left: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
}

/* Messages */
.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
    animation: fadeIn 0.2s ease-out;
}

.message.system {
    align-self: center;
    background-color: var(--light-gray);
    color: #6c757d;
    font-size: 0.85rem;
    padding: 5px 12px;
    border-radius: 12px;
    text-align: center;
    max-width: 90%;
}

.message.mine {
    align-self: flex-end;
    background-color: var(--primary-blue);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.message.theirs {
    align-self: flex-start;
    background-color: var(--light-blue);
    color: var(--dark-gray);
    border-bottom-left-radius: 4px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Controls Area - Thumb Friendly */
#controls {
    background-color: var(--white);
    padding: 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Input Row */
.input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

textarea#message-input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 1rem;
    resize: none;
    height: 44px; /* Standard touch target */
    max-height: 100px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

textarea#message-input:focus {
    border-color: var(--primary-blue);
}

button#send-btn {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-weight: 600;
    padding: 0 15px;
    height: 44px;
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.2s;
}

button#send-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* Action Row (Skip) */
.action-row {
    display: flex;
    justify-content: center;
}

button#next-btn {
    width: 100%;
    background-color: var(--white);
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 12px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

button#next-btn:active {
    background-color: var(--light-blue);
    transform: scale(0.98);
}

/* Screens / Overlays */
.screen {
    position: absolute;
    top: 50px; /* Header height */
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}

.hidden {
    display: none !important;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
    transition: transform 0.2s;
}

.btn-primary:active {
    transform: scale(0.95);
}

/* Wait Screen */
.wait-count {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin: 20px 0;
}

/* Ad Placeholders */
.ad-banner {
    width: 100%;
    height: 50px;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #aaa;
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.ad-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
}

.ad-content {
    background: white;
    width: 300px;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    margin-bottom: 20px;
}

.close-ad {
    color: white;
    border: 1px solid white;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    background: transparent;
}
