body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    margin: 0;
    padding: 2rem;
    box-sizing: border-box;
}

/* Center content for Send/Admin pages */
body:not(.display-mode) {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Layout Containers --- */
.pin-container, .admin-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    background: #1e1e1e;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.pin-container {
    max-width: 400px;
    text-align: center;
    margin-top: 50px;
}

/* --- Typography --- */
h1, h2, h3 {
    color: #ffcc00;
    margin-top: 0;
}

/* --- Form Elements --- */
input, textarea, select, button {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border-radius: 6px;
    border: 1px solid #333;
    background: #2c2c2c;
    color: white;
    font-size: 1rem;
    box-sizing: border-box;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

button {
    background-color: #0078d7;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

button:hover {
    background-color: #005a9e;
}

button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

/* --- Utility Classes --- */
.error { color: #ff6961; }
.success { color: #00ff7f; }
.small { font-size: 0.85rem; color: #aaa; }

/* --- Admin Specifics --- */
.message-box {
    background: #252525;
    border: 1px solid #333;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.message-box p { margin: 5px 0; }

.controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.controls button {
    width: auto;
    padding: 6px 12px;
    font-size: 0.9rem;
}

/* --- Send Page Specifics --- */
.instruction {
    background: #2a2a2a;
    color: #ffcc00;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.5;
    border-left: 4px solid #ffcc00;
    max-width: 600px;
}

.preview-container img, .thumb {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin-top: 10px;
    display: block;
}

.thumb { max-height: 150px; }

.color-selector {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    justify-content: center;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

.color-option.selected {
    border-color: #fff;
    transform: scale(1.1);
}

.drag-over {
    border: 2px dashed #ffcc00 !important;
    background-color: #333 !important;
}

/* --- Display Page Specifics --- */
body.display-mode {
    display: flex;
    justify-content: center; /* Horizontal Center */
    align-items: flex-start;
    height: 100vh;
    padding: 0;
    overflow: hidden;
    background-color: #000;
}

#scrollContainer {
    width: 100%;
    height: 100%;
    max-width: 900px; /* Limits width on big screens */
    position: relative;
    overflow: hidden;
    cursor: pointer; /* Indicates tap-to-pause */
}

#scrollingText {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    /* Performance optimization for smoother scrolling */
    will-change: transform;
}

.display-msg {
    width: 100%;
    max-width: 700px;
    margin: 0 auto 4rem auto; /* Center individual messages */
    background: #111;
    padding: 1.5rem;
    border-radius: 15px;
    box-sizing: border-box;
    text-align: center; /* Center text inside message */
    border: 1px solid #333;
}

.display-msg .timestamp {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.display-msg .msg-text {
    font-size: 1.5rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.display-msg img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-top: 1rem;
}

.voice-indicator {
    color: #4da6ff;
    font-size: 0.8em;
    vertical-align: middle;
    margin-left: 8px;
}

/* Audio Hint (RTL for Farsi) */
.audio-hint {
    background-color: #b71c1c;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: inline-block;
    animation: pulse 2s infinite;
    direction: rtl;
}

/* Hide hints once unlocked */
body.audio-unlocked .audio-hint { display: none; }

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.no-messages {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: #666;
    text-align: center;
}