/* ================================================
   Design tokens - retro Y2K social-network aesthetic
   Colors:
     --purple-900: #3C1A63  (deep header/footer)
     --purple-600: #6A3FB5  (primary brand)
     --purple-100: #EFE6FB  (soft panel bg)
     --gold-500:   #FFB627  (accent / karma stars)
     --paper:      #FBF8F3  (page background)
     --ink:        #2B1B45  (text)
   Type: "Baloo 2" for display (bubbly, Y2K), "Nunito" for body
   Signature: wavy-bottom header bar + tilted polaroid-style avatar frame
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&family=Nunito:wght@400;600;700&display=swap');

:root {
    --purple-900: #3C1A63;
    --purple-700: #522A8C;
    --purple-600: #6A3FB5;
    --purple-300: #B79CE8;
    --purple-100: #EFE6FB;
    --gold-500: #FFB627;
    --gold-600: #E89F14;
    --paper: #FBF8F3;
    --ink: #2B1B45;
    --ink-soft: #6B5A8A;
    --card-shadow: 0 4px 14px rgba(60, 26, 99, 0.12);
}

* { box-sizing: border-box; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: 'Nunito', sans-serif;
    padding-bottom: 40px;
}

h1, h2, h3, h4, .brand-font {
    font-family: 'Baloo 2', cursive;
    color: var(--purple-900);
}

a { color: var(--purple-600); text-decoration: none; }
a:hover { color: var(--gold-600); }

/* ---------- Top nav with wavy bottom edge (signature element) ---------- */
.ok-navbar {
    background: linear-gradient(120deg, var(--purple-900), var(--purple-600));
    padding: 10px 0 26px 0;
    position: relative;
    margin-bottom: 34px;
}
.ok-navbar::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -18px;
    height: 20px;
    background: var(--purple-600);
    -webkit-mask: radial-gradient(circle at 10px 0, transparent 10px, black 11px) 0 -10px / 20px 20px repeat-x;
    mask: radial-gradient(circle at 10px 0, transparent 10px, black 11px) 0 -10px / 20px 20px repeat-x;
    opacity: 0.35;
}
.ok-navbar .navbar-brand {
    font-family: 'Baloo 2', cursive;
    font-weight: 800;
    font-size: 1.6rem;
    color: #fff !important;
    letter-spacing: 0.5px;
}
.ok-navbar .navbar-brand span { color: var(--gold-500); }
.ok-navbar .nav-link {
    color: #EDE4FB !important;
    font-weight: 600;
}
.ok-navbar .nav-link:hover { color: var(--gold-500) !important; }
.ok-navbar .form-control {
    border-radius: 20px;
    border: none;
}

/* ---------- Cards ---------- */
.ok-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    border: none;
    margin-bottom: 20px;
}
.ok-card .card-header {
    background: var(--purple-100);
    border-radius: 16px 16px 0 0 !important;
    font-family: 'Baloo 2', cursive;
    color: var(--purple-900);
    font-weight: 700;
    border: none;
    padding: 12px 18px;
}
.ok-card .card-body { padding: 18px; }

/* ---------- Polaroid-tilt avatar frame (signature element) ---------- */
.ok-avatar-frame {
    background: #fff;
    padding: 8px 8px 22px 8px;
    border-radius: 4px;
    box-shadow: 0 6px 16px rgba(60,26,99,0.25);
    display: inline-block;
    transform: rotate(-3deg);
    transition: transform 0.25s ease;
}
.ok-avatar-frame:hover { transform: rotate(0deg) scale(1.02); }
.ok-avatar-frame img {
    display: block;
    width: 100%;
    border-radius: 2px;
    object-fit: cover;
}
.ok-avatar-sm { border-radius: 10px; object-fit: cover; }

/* ---------- Buttons ---------- */
.btn-ok-primary {
    background: var(--purple-600);
    border: none;
    color: #fff;
    font-weight: 700;
    border-radius: 20px;
    padding: 8px 20px;
}
.btn-ok-primary:hover { background: var(--purple-900); color: #fff; }
.btn-ok-gold {
    background: var(--gold-500);
    border: none;
    color: var(--purple-900);
    font-weight: 700;
    border-radius: 20px;
    padding: 8px 20px;
}
.btn-ok-gold:hover { background: var(--gold-600); color: var(--purple-900); }
.btn-ok-outline {
    background: transparent;
    border: 2px solid var(--purple-600);
    color: var(--purple-600);
    font-weight: 700;
    border-radius: 20px;
    padding: 6px 18px;
}
.btn-ok-outline:hover { background: var(--purple-600); color: #fff; }

/* ---------- Scraps ---------- */
.scrap-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--purple-100);
}
.scrap-item:last-child { border-bottom: none; }
.scrap-meta { font-size: 0.8rem; color: var(--ink-soft); }
.scrap-bubble {
    background: var(--purple-100);
    border-radius: 12px;
    padding: 10px 14px;
    flex: 1;
}

/* ---------- Karma stars ---------- */
.ok-stars { color: var(--gold-500); }

/* ---------- Community tile ---------- */
.community-tile {
    border-radius: 14px;
    color: #fff;
    padding: 16px;
    height: 100%;
    box-shadow: var(--card-shadow);
}
.community-tile h5 { color: #fff; font-family: 'Baloo 2', cursive; }
.community-tile a.stretched-link { color: #fff; }

/* ---------- Auth pages ---------- */
.ok-auth-wrap {
    max-width: 420px;
    margin: 60px auto;
}
.ok-auth-wrap .ok-card { padding: 6px; }
.ok-logo-hero {
    text-align: center;
    margin-bottom: 20px;
}
.ok-logo-hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
}
.ok-logo-hero p { color: var(--ink-soft); }

/* ---------- Misc ---------- */
.badge-ok {
    background: var(--purple-100);
    color: var(--purple-900);
    border-radius: 10px;
    font-weight: 600;
    padding: 4px 10px;
}
.section-title {
    font-family: 'Baloo 2', cursive;
    color: var(--purple-900);
    font-weight: 700;
    margin-bottom: 14px;
}

/* ================================================
   Chat widget - Google Talk style dock + popups
   ================================================ */
.chat-dock {
    position: fixed;
    right: 16px;
    bottom: 0;
    width: 230px;
    z-index: 1040;
    font-family: 'Nunito', sans-serif;
}
.chat-dock-header {
    background: var(--purple-900);
    color: #fff;
    border-radius: 10px 10px 0 0;
    padding: 8px 14px;
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: 0 -2px 8px rgba(60,26,99,0.2);
}
.chat-dock-header .badge {
    background: var(--gold-500);
    color: var(--purple-900);
}
.chat-dock-list {
    background: #fff;
    border: 1px solid var(--purple-100);
    border-top: none;
    max-height: 320px;
    overflow-y: auto;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 -2px 8px rgba(60,26,99,0.12);
}
.chat-dock-list.collapsed { display: none; }
.chat-dock-friend {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f4f0fb;
    position: relative;
}
.chat-dock-friend:hover { background: var(--purple-100); }
.chat-dock-friend img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.chat-status-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #C7C0D6;
    border: 2px solid #fff;
    position: absolute;
    left: 30px; top: 26px;
}
.chat-status-dot.online { background: #3FBF6A; }
.chat-dock-friend .unread-badge {
    margin-left: auto;
    background: var(--gold-500);
    color: var(--purple-900);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
}
.chat-dock-empty { padding: 14px; color: var(--ink-soft); font-size: 0.85rem; text-align: center; }

/* Popup chat windows sit to the left of the dock, one per open conversation */
.chat-windows {
    position: fixed;
    bottom: 0;
    right: 260px;
    display: flex;
    flex-direction: row-reverse;
    gap: 10px;
    z-index: 1040;
}
.chat-window {
    width: 260px;
    background: #fff;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -2px 10px rgba(60,26,99,0.2);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--purple-100);
}
.chat-window-header {
    background: var(--purple-600);
    color: #fff;
    padding: 8px 10px;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.chat-window-header img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.chat-window-header .name { font-weight: 700; flex: 1; font-size: 0.9rem; }
.chat-window-header .close-btn { cursor: pointer; opacity: 0.85; }
.chat-window-header .close-btn:hover { opacity: 1; }
.chat-window-body {
    height: 260px;
    overflow-y: auto;
    padding: 10px;
    font-size: 0.87rem;
    background: var(--paper);
}
.chat-window.minimized .chat-window-body,
.chat-window.minimized .chat-window-input { display: none; }
.chat-msg { margin-bottom: 8px; display: flex; }
.chat-msg.mine { justify-content: flex-end; }
.chat-msg-bubble {
    max-width: 80%;
    padding: 6px 10px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(60,26,99,0.15);
}
.chat-msg.mine .chat-msg-bubble { background: var(--purple-100); }
.chat-msg-time { font-size: 0.65rem; color: var(--ink-soft); display: block; margin-top: 2px; }
.chat-window-input {
    display: flex;
    border-top: 1px solid var(--purple-100);
}
.chat-window-input input {
    flex: 1;
    border: none;
    padding: 8px 10px;
    font-size: 0.85rem;
    border-radius: 0 0 0 10px;
}
.chat-window-input input:focus { outline: none; }
.chat-window-input button {
    border: none;
    background: var(--purple-600);
    color: #fff;
    padding: 0 14px;
    border-radius: 0 0 10px 0;
}
.chat-window-input button:hover { background: var(--purple-900); }

@media (max-width: 700px) {
    .chat-windows { right: 0; left: 0; justify-content: center; }
    .chat-window { width: 92vw; }
    .chat-dock { right: 8px; width: 180px; }
}
