/* ═══════════════════════════════════════════════════════════
   ClosedAI — Meme ChatGPT Parody Theme
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f7f5f0;
    --bg-chat: #faf8f4;
    --sidebar-bg: #eae6da;
    --sidebar-border: #d9d3c4;
    --green: #10a37f;
    --green-light: #c4ede0;
    --green-dark: #0d8a6a;
    --orange: #e87b35;
    --pink: #e84393;
    --purple: #6c5ce7;
    --blue: #0984e3;
    --red: #d63031;
    --text: #2d3436;
    --text-light: #636e72;
    --text-muted: #b2bec3;
    --card-bg: #fff;
    --card-border: #e0dcd2;
    --card-hover: #f0ece3;
    --input-bg: #fff;
    --input-border: #d9d3c4;
    --msg-user-bg: #e8f5e9;
    --msg-ai-bg: #fff;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --radius: 12px;
    --transition: 0.2s ease;
    --sans: 'Inter', -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    height: 100%;
    display: flex;
    overflow: hidden;
}

/* ═══ SIDEBAR ═══ */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-top { padding: 16px; }

.new-chat-btn {
    width: 100%;
    padding: 12px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
}
.new-chat-btn:hover { background: var(--green-dark); }

.sidebar-section {
    padding: 0 16px;
    margin-bottom: 16px;
}

.sidebar-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--orange);
    margin-bottom: 10px;
}

.resume-list {
    list-style: none;
    padding: 12px;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: var(--radius);
}

.resume-list li {
    font-size: 12px;
    color: var(--text);
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot.green { background: var(--green); }
.dot.orange { background: var(--orange); }
.dot.pink { background: var(--pink); }
.dot.purple { background: var(--purple); }
.dot.blue { background: var(--blue); }

.sidebar-warning {
    margin: 0 16px 16px;
    padding: 14px;
    background: #fff3e0;
    border: 2px solid var(--orange);
    border-radius: var(--radius);
}

.warning-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--orange);
    margin-bottom: 6px;
}

.sidebar-warning p {
    font-size: 11px;
    color: var(--text);
    line-height: 1.5;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--sidebar-border);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-plan {
    font-size: 11px;
    color: var(--green);
    font-weight: 600;
}

/* ═══ MAIN AREA ═══ */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.sidebar-toggle {
    display: none;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    color: var(--text);
    letter-spacing: 2px;
}

/* ═══ WELCOME SCREEN ═══ */
.welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    overflow-y: auto;
}

.welcome-logo-wrap {
    position: relative;
    margin-bottom: 20px;
}

.welcome-logo {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.sparkle {
    position: absolute;
    font-size: 20px;
    color: var(--orange);
    animation: sparkle-float 2s ease-in-out infinite;
    pointer-events: none;
}
.sparkle.s1 { top: -8px; right: -12px; animation-delay: 0s; }
.sparkle.s2 { bottom: -4px; left: -12px; animation-delay: 1s; }

@keyframes sparkle-float {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 1; }
    50% { transform: translateY(-6px) rotate(15deg); opacity: 0.5; }
}

.welcome-title {
    font-size: 48px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -1px;
}

.welcome-sub {
    font-size: 15px;
    font-weight: 600;
    color: var(--green);
    margin-bottom: 4px;
}

.welcome-warn {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 36px;
}

/* ═══ SUGGESTION CARDS ═══ */
.suggestions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 700px;
    width: 100%;
}

.suggestion-card {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.suggestion-card:hover {
    border-color: var(--green);
    background: var(--card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.suggestion-icon {
    font-size: 18px;
}

/* ═══ CHAT MESSAGES ═══ */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: none;
    flex-direction: column;
    gap: 16px;
}

.chat-messages.active {
    display: flex;
}

.message {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    animation: msgIn 0.3s ease;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.msg-avatar.user {
    background: var(--green-light);
    color: var(--green-dark);
}

.msg-avatar.ai {
    overflow: hidden;
}
.msg-avatar.ai img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.msg-body {
    flex: 1;
}

.msg-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 4px;
}

.msg-text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
    background: var(--msg-ai-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 14px 18px;
    white-space: pre-wrap;
    word-break: break-word;
}

.message.user .msg-text {
    background: var(--msg-user-bg);
    border-color: #c8e6c9;
}

.msg-text.typing::after {
    content: '|';
    animation: blink 0.7s infinite;
    color: var(--green);
    font-weight: 700;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ═══ INPUT AREA ═══ */
.input-area {
    padding: 16px 24px 12px;
    background: var(--bg);
}

.input-wrap {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 16px;
    padding: 6px 6px 6px 18px;
    transition: border-color var(--transition);
}
.input-wrap:focus-within {
    border-color: var(--green);
}

#chatInput {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--text);
    background: transparent;
}
#chatInput::placeholder { color: var(--text-muted); }

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: var(--green);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}
.send-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}
.send-btn:not(:disabled):hover {
    background: var(--green-dark);
    transform: scale(1.05);
}

.disclaimer {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ═══ SCROLLBAR ═══ */
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 3px; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
    .suggestions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 100;
        transition: left 0.3s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    }
    .sidebar.open { left: 0; }
    .sidebar-toggle { display: block; }
    .welcome-title { font-size: 36px; }
    .suggestions { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 500px) {
    .suggestions { grid-template-columns: 1fr; }
    .welcome-title { font-size: 28px; }
    .welcome-logo { width: 70px; height: 70px; }
}
