/* ========================================
   Rorak V1 — Minimal Black & White UI
   ======================================== */


/* ── Reset & Base ── */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 Helvetica, Arial, sans-serif;
    background: #fff;
    color: #111;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* ── App Layout ── */

.app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}


/* ── Sidebar ── */

.sidebar {
    width: 260px;
    min-width: 260px;
    background: #000;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    z-index: 100;
}

.sidebar-brand {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 48px;
    color: #fff;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    display: block;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 500;
}

.nav-item.disabled {
    cursor: default;
    opacity: 0.3;
    pointer-events: none;
}

.nav-badge {
    display: block;
    font-size: 11px;
    opacity: 0.65;
    margin-top: 3px;
    font-weight: 400;
}


/* ── Mobile Menu Toggle ── */

.menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 40px;
    height: 40px;
    background: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 90;
}

.sidebar-overlay.active {
    display: block;
}


/* ── Main Area ── */

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #fff;
}


/* ── Empty State ── */

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
}

.brand-title {
    font-size: 44px;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.brand-tagline {
    font-size: 16px;
    color: #888;
    margin-bottom: 16px;
    font-weight: 400;
}

.brand-description {
    font-size: 14px;
    color: #aaa;
    line-height: 1.7;
    max-width: 360px;
}


/* ── Chat Messages ── */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 32px 32px 16px;
    display: none;
}

.chat-messages.active {
    display: block;
}

/* Minimal scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.message {
    max-width: 720px;
    margin-bottom: 32px;
}

.message-user {
    margin-left: auto;
    text-align: right;
}

.message-assistant {
    margin-right: auto;
}

.message-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
    margin-bottom: 6px;
    font-weight: 500;
}

.message-content {
    font-size: 15px;
    line-height: 1.7;
    color: #222;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-user .message-content {
    color: #333;
}

.message-assistant .message-content {
    color: #111;
}


/* ── Loading Dots ── */

.loading-dots {
    display: inline-flex;
    gap: 5px;
    padding: 8px 0;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: dotPulse 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 80%, 100% {
        opacity: 0.25;
        transform: scale(0.85);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}


/* ── Input Area ── */

.input-area {
    flex-shrink: 0;
    padding: 0 32px 24px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.input-bar {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 28px;
    padding: 4px;
    background: #fafafa;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.input-bar:focus-within {
    border-color: #bbb;
    background: #fff;
}

.btn-upload,
.btn-send {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    font-family: inherit;
}

.btn-upload {
    background: transparent;
    color: #888;
}

.btn-upload:hover {
    background: #eee;
    color: #000;
}

.btn-upload:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-send {
    background: #000;
    color: #fff;
}

.btn-send:hover {
    background: #222;
}

.btn-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
    color: #111;
    padding: 8px 8px;
    font-family: inherit;
    min-width: 0;
}

.chat-input::placeholder {
    color: #aaa;
}


/* ── Upload Indicator ── */

.upload-indicator {
    display: none;
    margin-bottom: 10px;
    padding-left: 4px;
}

.upload-indicator.active {
    display: flex;
    align-items: center;
}

.upload-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    font-size: 13px;
    color: #555;
}

.upload-chip-remove {
    cursor: pointer;
    font-size: 15px;
    color: #aaa;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    transition: color 0.15s ease;
}

.upload-chip-remove:hover {
    color: #000;
}


/* ── Notifications ── */

.notification {
    display: none;
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    background: #f5f5f5;
    color: #555;
    border: 1px solid #e5e5e5;
}

.notification.active {
    display: block;
}


/* ── Shake Animation ── */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(3px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

.shake {
    animation: shake 0.35s ease;
}


/* ── Responsive — Tablet ── */

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        transition: left 0.25s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .empty-state {
        padding: 24px 20px;
        padding-top: 64px;
    }

    .brand-title {
        font-size: 36px;
    }

    .chat-messages {
        padding: 64px 20px 16px;
    }

    .input-area {
        padding: 0 16px 16px;
    }

    .message {
        max-width: 100%;
    }
}


/* ── Responsive — Phone ── */

@media (max-width: 480px) {
    .brand-title {
        font-size: 30px;
    }

    .brand-tagline {
        font-size: 14px;
    }

    .brand-description {
        font-size: 13px;
    }

    .chat-input {
        font-size: 16px; /* prevent iOS zoom on focus */
    }

    .input-area {
        padding: 0 12px 12px;
    }
}
