/* Wall of Ambition — Main Styles */

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

html, body {
    height: 100%;
    overflow: hidden;
    background: #111;
    color: #fff;
    font-family: 'Caveat', cursive;
}

/* ── Header ── */
header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 18px 32px;
    background: #0d0d0d;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    position: relative;
    z-index: 10;
}

header h1 {
    font-family: 'Permanent Marker', cursive;
    font-size: 2rem;
    color: #fff;
}

header p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.4);
}

.admin-link {
    margin-left: auto;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.3);
    text-decoration: none;
}
.admin-link:hover { color: rgba(255,255,255,0.6); }

/* ── Main layout: wall 75% | feed 25% ── */
.main-layout {
    display: flex;
    height: calc(100vh - 65px - 60px); /* minus header and share bar */
}

.wall-panel {
    flex: 0 0 75%;
    position: relative;
    overflow: hidden;
}

.feed-panel {
    flex: 0 0 25%;
    display: flex;
    flex-direction: column;
    background: #0d0d0d;
    border-left: 1px solid rgba(255,255,255,0.07);
    overflow: hidden;
}

/* ── Wall (chalkboard + post-its) ── */
.wall {
    width: 100%;
    height: 100%;
    position: relative;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(30,10,60,0.35) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(10,30,60,0.25) 0%, transparent 50%),
        #141414;
    overflow: hidden;
}

.wall-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.3);
    font-size: 1.2rem;
}

/* ── Post-it notes ── */
.note {
    position: absolute;
    padding: 10px 12px 14px;
    font-family: 'Caveat', cursive;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    color: #1c1917;
    cursor: default;
    box-shadow: 2px 3px 10px rgba(0,0,0,0.55), 0 1px 2px rgba(0,0,0,0.3);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s ease,
                z-index 0s;
    max-width: 200px;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    transform-origin: center center;
}

/* Hover: zoom to 2.5× and pop forward */
.note:hover {
    transform: scale(2.5) rotate(0deg) !important;
    box-shadow: 8px 12px 32px rgba(0,0,0,0.75);
    z-index: 100 !important;
}

/* Tape strip on some notes */
.note.tape::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 14px;
    background: rgba(255,255,255,0.35);
    border-radius: 2px;
}

/* Post-it color variants */
.note.yellow { background: #fef08a; }
.note.pink   { background: #fda4af; }
.note.blue   { background: #93c5fd; }
.note.green  { background: #86efac; }
.note.purple { background: #d8b4fe; }
.note.orange { background: #fdba74; }
.note.white  { background: #f5f5f4; }

/* Size variants by frequency */
.note.size-sm { font-size: 0.82rem;  max-width: 165px; padding: 8px 10px 12px; }
.note.size-md { font-size: 0.95rem;  max-width: 190px; }
.note.size-lg { font-size: 1.1rem;   max-width: 215px; padding: 12px 14px 18px; }
.note.size-xl { font-size: 1.3rem;   max-width: 240px; padding: 14px 16px 20px; }

/* ── Feed panel ── */
.feed-title {
    font-family: 'Permanent Marker', cursive;
    font-size: 1.1rem;
    color: #000;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
    background: #f0f0f0;
}

.feed-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.feed-list::-webkit-scrollbar { width: 4px; }
.feed-list::-webkit-scrollbar-track { background: transparent; }
.feed-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.feed-loading {
    color: rgba(255,255,255,0.3);
    font-size: 1rem;
    text-align: center;
    margin-top: 20px;
}

.feed-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    animation: fadeInSlide 0.4s ease-out;
}

.feed-item-ambition {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 4px;
    line-height: 1.3;
}

.feed-item-meta {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.75rem;
    color: #888;
    display: flex;
    justify-content: space-between;
}

.feed-item-time {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.7rem;
    color: #aaa;
    margin-top: 3px;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Share bar ── */
.share-bar {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d0d0d;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.share-btn {
    background: #fef08a;
    color: #1c1917;
    font-family: 'Permanent Marker', cursive;
    font-size: 1rem;
    padding: 10px 36px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    box-shadow: 2px 3px 10px rgba(0,0,0,0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}

.share-btn:hover {
    transform: scale(1.04);
    box-shadow: 4px 6px 16px rgba(0,0,0,0.5);
}

/* ── Popup form font ── */
#popup-container,
#popup-container input,
#popup-container textarea,
#popup-container label,
#popup-container p,
#popup-container button {
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 14px;
}

#popup-container h2 {
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 1.4rem;
}

/* ── Popup ── */
#popup-overlay.show {
    display: flex !important;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#popup-container {
    animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Form progress dots ── */
.progress-step {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: all 0.3s;
}
.progress-step.active    { background: #8b5cf6; transform: scale(1.2); }
.progress-step.completed { background: #10b981; }

/* ── Spinner ── */
.spinner {
    border: 3px solid #f3f4f6;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: #10b981;
    color: #fff;
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 200;
    animation: slideInRight 0.3s ease-out;
}
.toast.error { background: #ef4444; }

@keyframes slideInRight {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ── Mobile Bottom Nav (hidden on desktop) ── */
.mobile-bottom-nav { display: none; }

/* ── Mobile: touch devices — disable sticky hover on notes ── */
@media (hover: none) {
    .note:hover {
        transform: none !important;
        z-index: auto !important;
        box-shadow: 2px 3px 10px rgba(0,0,0,0.55), 0 1px 2px rgba(0,0,0,0.3) !important;
    }
}

/* ── Mobile layout ── */
@media (max-width: 768px) {

    /* Header: stack vertically, centered */
    header {
        height: auto !important;
        flex-direction: column !important;
        align-items: center !important;
        padding: 10px 16px !important;
        gap: 3px !important;
        text-align: center !important;
    }
    .title-group { align-items: center !important; }
    header p { text-align: center !important; }
    #desktop-share-wrapper { display: none !important; }

    /* Wall takes full width; feed overlays when active */
    .wall-panel { flex: 0 0 100% !important; width: 100% !important; }
    .feed-panel {
        position: fixed !important;
        inset: 0 !important;
        bottom: 64px !important;
        width: 100% !important;
        flex: none !important;
        display: none !important;
        z-index: 40 !important;
    }
    .feed-panel.mobile-visible { display: flex !important; }

    /* Slightly smaller post-its on mobile — still wide enough to avoid word breaks */
    .note.size-sm { font-size: 0.75rem !important; max-width: 140px !important; padding: 6px 9px 10px !important; }
    .note.size-md { font-size: 0.82rem !important; max-width: 158px !important; }
    .note.size-lg { font-size: 0.92rem !important; max-width: 175px !important; padding: 9px 11px 13px !important; }

    /* Tapped state (replaces hover on mobile) */
    .note.tapped {
        transform: scale(2.5) rotate(0deg) !important;
        z-index: 100 !important;
        box-shadow: 8px 12px 32px rgba(0,0,0,0.75) !important;
        transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    }

    /* Bottom nav */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 64px;
        background: #0d0d0d;
        border-top: 1px solid rgba(255,255,255,0.1);
        z-index: 50;
    }
    .mobile-nav-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: none;
        border: none;
        color: rgba(255,255,255,0.4);
        font-family: Arial, Helvetica, sans-serif;
        font-size: 0.68rem;
        letter-spacing: 0.03em;
        cursor: pointer;
        transition: color 0.2s;
        padding: 0 8px;
    }
    .mobile-nav-tab.active { color: #00b8c4; }
    .mobile-nav-tab svg { width: 20px; height: 20px; }
    .mobile-nav-share {
        flex: 1.8;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #00b8c4;
        border: none;
        border-radius: 8px;
        margin: 10px 8px;
        color: #fff;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 0.85rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        cursor: pointer;
        transition: background 0.15s;
    }
    .mobile-nav-share:active { background: #009aa5; }

    /* Push footer above bottom nav */
    footer { margin-bottom: 64px; }
}
