/* --- 1. CORE RESET & MOBILE OPTIMIZATION --- */
:root {
    --neon: #00f2ff;
    --neon-purple: #7000ff;
    --bg: #050507;
    --card: #121217;
    --gray: #222228;
    --text: #ffffff;
    --danger: #ff0055;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden; /* Prevents bouncing on mobile */
    
    /* --- 2. TURN OFF TEXT SELECTION --- */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Re-enable selection for inputs so typing works */
input, textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* --- 3. PAGE SYSTEM --- */
.page {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    flex-direction: column;
    background: var(--bg);
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* --- 4. AUTH / LOGIN STYLES --- */
.auth-center {
    padding: 40px 20px;
    text-align: center;
    margin: auto;
    width: 100%;
    max-width: 400px;
}

.neon-txt {
    font-size: 28px;
    color: var(--neon);
    text-shadow: 0 0 15px var(--neon);
    letter-spacing: 4px;
    margin-bottom: 30px;
}

input {
    width: 100%;
    padding: 16px;
    margin-bottom: 15px;
    background: #1a1a20;
    border: 1px solid var(--gray);
    color: #fff;
    border-radius: 12px;
    font-size: 16px; /* Prevents iPhone Zoom */
    transition: 0.3s;
}

input:focus {
    border-color: var(--neon);
    outline: none;
    background: #202025;
}

.btn-glow {
    background: var(--neon);
    color: #000;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 16px;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.2);
}

.btn-glow:active {
    transform: scale(0.95);
    filter: brightness(1.2);
}

/* --- 5. NAVIGATION --- */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--card);
    border-bottom: 1px solid var(--gray);
}

.logo {
    font-weight: bold;
    color: var(--neon);
    font-size: 14px;
    letter-spacing: 1px;
}

.nav-btn {
    background: var(--gray);
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

/* --- 6. CHAT & MESSAGES --- */
#chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 85%;
    font-size: 15px;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

/* User Roles/Names in chat */
.msg-bubble small {
    display: block;
    font-size: 10px;
    margin-bottom: 4px;
    opacity: 0.7;
}

.input-row {
    padding: 12px;
    background: var(--card);
    display: flex;
    gap: 10px;
    padding-bottom: 30px; /* Space for home bar on newer phones */
}

/* --- 7. ACTION BUTTONS (Mic/Send) --- */
.action-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--gray);
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn.cyan {
    background: var(--neon);
    color: #000;
}

/* Efficient Mic Recording Animation */
.action-btn.recording {
    background: var(--danger) !important;
    box-shadow: 0 0 25px var(--danger);
    animation: mic-pulse 1.5s infinite;
}

@keyframes mic-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* --- 8. VAULT & ADMIN PANELS --- */
.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.admin-card {
    background: var(--card);
    padding: 18px;
    border-radius: 16px;
    margin-bottom: 15px;
    border: 1px solid var(--gray);
}

.admin-card h3 {
    font-size: 14px;
    margin-bottom: 15px;
    color: var(--neon);
    text-transform: uppercase;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray);
    color: #fff;
    padding: 12px;
    border-radius: 10px;
    width: 100%;
    margin-bottom: 10px;
    font-size: 14px;
    text-align: center;
}

/* --- 9. PREVIEW OVERLAY --- */
#preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.98);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#preview-overlay img, #preview-overlay iframe {
    max-width: 95%;
    max-height: 75%;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.close-preview {
    position: absolute;
    top: 30px;
    right: 20px;
    padding: 12px 25px;
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
}
