/* --- 1. Canvas & Wrapper Setup --- */
html, body {
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    letter-spacing: -0.01em;
    overflow: auto;
}

#everpin-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

#board {
    width: 5000px;
    height: 5000px;
    background-color: #1a1a1a;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    position: relative;
    overflow: hidden;
    transform-origin: 0 0;
    transition: transform 0.4s ease;
}

/* --- 2. Floating Navigation Controls --- */
.nav-btn {
    position: fixed;
    top: 20px;
    z-index: 10000;
    width: 48px;
    height: 48px;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 30, 30, 0.9);
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 6px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    transition: background 0.2s, transform 0.2s;
    font-family: inherit;
}

.nav-btn:hover {
    background: rgba(60, 60, 60, 1);
    transform: scale(1.05);
}

/* --- 3. Polaroids (Pins) --- */
.pin {
    position: absolute;
    width: 200px;
    height: 240px;
    background: #f9f9f9;
    padding: 12px 12px 18px 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
    cursor: grab;
    user-select: none;
    border-radius: 2px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    touch-action: none;
    transform: rotate(var(--rot, 0deg));
    
    /* NEW: Glide transition for the randomize button */
    transition: left 0.4s ease-out, top 0.4s ease-out, transform 0.4s ease-out; 
}

/* NEW: Kill the transition while dragging so it doesn't lag behind the mouse */
.pin.is-dragging {
    transition: none !important;
}

.pin:active {
    cursor: grabbing;
    transform: rotate(var(--rot, 0deg)) scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.7);
}

.pin img {
    width: 100%;
    height: 145px;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.polaroid-text {
    font-size: 11px;
    color: #333;
    margin: 8px 0 0 0;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.polaroid-stamp {
    font-size: 8.5px;
    color: #666;
    margin-top: auto;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- 4. Modal Display --- */
#pin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

#pin-modal.hidden {
    display: none;
}

.modal-content {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: #fff;
}

#modal-image {
    max-width: 100%;
    max-height: 350px;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 15px;
}

.pin-modal-body {
    color: #ccc;
    font-size: 13px;
    line-height: 1.6;
    text-align: left;
    margin-bottom: 15px;
}

.modal-action-btn {
    background: #333;
    color: #e0e0e0;
    border: 1px solid #555;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.modal-action-btn:hover {
    background: #444;
}

/* --- 5. Comments Section --- */
.comment-item {
    border-bottom: 1px solid #333;
    padding: 8px 0;
}

.comment-meta {
    font-size: 11px;
    color: #888;
    margin-bottom: 3px;
}

.comment-text {
    font-size: 12px;
    color: #ddd;
    line-height: 1.4;
}

/* --- 6. Hint Bubble / Onboarding Toast --- */
.everpin-hint-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}

.everpin-hint-bubble {
    background: rgba(20, 20, 20, 0.85);
    color: #f0f0f0;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.everpin-hint-bubble.show {
    opacity: 1;
    transform: translateY(0);
}

.everpin-hint-bubble.hide {
    opacity: 0;
    transform: translateY(-10px);
}