/* ═══════════════════════════════════════ */
/*        PINTEREST MODAL                  */
/* ═══════════════════════════════════════ */

.pin-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.pin-modal.active {
    pointer-events: all;
    opacity: 1;
    visibility: visible;
}

.pin-modal-inner {
    width: 1200px;
    max-width: 95vw;
    max-height: 92vh;
    background: #fff;
    border-radius: 24px;
    position: relative;
    overflow-y: auto;
    transform: scale(0.3);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(.4,0,.2,1), opacity 0.3s;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.pin-modal.active .pin-modal-inner {
    transform: scale(1);
    opacity: 1;
}
.pin-modal-inner::-webkit-scrollbar { width: 0; }

/* ═══ HEADER BAR ═══ */
.pin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #efefef;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 5;
    border-radius: 24px 24px 0 0;
}
.pin-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pin-logo { flex-shrink: 0; }
.pin-brand-name {
    font-weight: 800;
    font-size: 18px;
    color: #333;
    letter-spacing: -0.3px;
}
.pin-brand-handle {
    display: block;
    font-size: 12px;
    color: #888;
    font-weight: 500;
}
.pin-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pin-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f1f1;
    border-radius: 24px;
    padding: 8px 16px;
    transition: background 0.2s, box-shadow 0.2s;
}
.pin-search:focus-within {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(230,0,35,0.15);
}
.pin-search svg { color: #888; flex-shrink: 0; }
.pin-search input {
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    width: 180px;
    color: #333;
    font-family: inherit;
}
.pin-search input::placeholder { color: #aaa; }
.pin-close {
    width: 40px; height: 40px;
    border: none;
    background: #f1f1f1;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.2s, transform 0.2s;
}
.pin-close:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

/* ═══ PROFILE ═══ */
.pin-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 28px;
    border-bottom: 1px solid #efefef;
}
.pin-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.pin-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pin-profile-info h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #111;
}
.pin-profile-info p {
    margin: 2px 0 0;
    font-size: 13px;
    color: #888;
}
.pin-profile-stats {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    font-size: 13px;
    color: #666;
}
.pin-profile-stats b { color: #111; font-weight: 700; }
.pin-follow-btn {
    margin-left: auto;
    padding: 12px 24px;
    background: #E60023;
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}
.pin-follow-btn:hover { background: #c2001e; transform: scale(1.02); }

/* ═══ BOARDS (tabs) ═══ */
.pin-boards {
    display: flex;
    gap: 8px;
    padding: 16px 28px;
    border-bottom: 1px solid #efefef;
}
.pin-board {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #f1f1f1;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}
.pin-board:hover { background: #e0e0e0; }
.pin-board.active {
    background: #111;
    color: #fff;
}
.pin-board-icon { font-size: 15px; }

/* ═══ MASONRY GRID ═══ */
.pin-grid {
    columns: 5;
    column-gap: 12px;
    padding: 16px 20px 40px;
}
.pin-item {
    break-inside: avoid;
    margin-bottom: 12px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
    background: #f5f5f5;
}
.pin-item video,
.pin-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.pin-item:hover video,
.pin-item:hover img {
    transform: scale(1.03);
}

/* Hover overlay — Pinterest style */
.pin-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 12px;
    opacity: 0;
    transition: all 0.25s;
}
.pin-item:hover .pin-overlay {
    background: rgba(0,0,0,0.35);
    opacity: 1;
}
.pin-save {
    padding: 8px 16px;
    background: #E60023;
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.pin-save:hover {
    background: #c2001e;
    transform: scale(1.08);
}

/* Video play badge */
.pin-play {
    position: absolute;
    top: 12px; left: 12px;
    width: 32px; height: 32px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: transform 0.3s;
}
.pin-item:hover .pin-play { transform: scale(1.15); }
.pin-play::after {
    content: '';
    width: 0; height: 0;
    border-style: solid;
    border-width: 6px 0 6px 10px;
    border-color: transparent transparent transparent white;
    margin-left: 2px;
}

/* Loading */
.pin-loading {
    column-span: all;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 80px;
    color: #999;
    font-size: 14px;
}
.pin-spinner {
    width: 32px; height: 32px;
    border: 3px solid #eee;
    border-top-color: #E60023;
    border-radius: 50%;
    animation: pinSpin 0.7s linear infinite;
}
@keyframes pinSpin { to { transform: rotate(360deg); } }

/* Load more */
.pin-load-more {
    column-span: all;
    padding: 20px;
    text-align: center;
    background: #f1f1f1;
    color: #E60023;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border-radius: 24px;
    margin-top: 8px;
    transition: background 0.2s;
}
.pin-load-more:hover { background: #e8e8e8; }

/* ═══════════════════════════════════════ */
/*        PINTEREST VIEWER                 */
/* ═══════════════════════════════════════ */

.feed-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.feed-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
}
.pin-viewer {
    position: relative;
    display: flex;
    max-width: 1000px;
    max-height: 90vh;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    z-index: 2;
}
.pin-viewer-media {
    flex: 1;
    min-width: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pin-viewer-media video {
    width: 100%;
    max-height: 90vh;
    object-fit: contain;
}
.pin-viewer-media img {
    width: 100%;
    max-height: 90vh;
    object-fit: contain;
}
.pin-viewer-sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
}
.pin-viewer-actions {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
}
.pin-save-btn {
    padding: 12px 24px;
    background: #E60023;
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.pin-save-btn:hover { background: #c2001e; }
.pin-viewer-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.pin-viewer-author img {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.pin-viewer-author strong {
    display: block;
    font-size: 14px;
    color: #111;
}
.pin-viewer-author span {
    font-size: 12px;
    color: #888;
}
.pin-viewer-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin: 0 0 auto;
}
.pin-viewer-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}
.pin-nav-btn {
    padding: 8px 16px;
    background: #f1f1f1;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #333;
    transition: background 0.2s;
}
.pin-nav-btn:hover { background: #e0e0e0; }
.pin-viewer-nav span {
    font-size: 12px;
    color: #999;
}

.feed-modal-close {
    position: absolute;
    top: 16px; right: 16px;
    color: #fff;
    font-size: 28px;
    width: 44px; height: 44px;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}
.feed-modal-close:hover { background: rgba(0,0,0,0.5); }

/* ═══ PROGRESS BAR ═══ */
.pin-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 28px;
    background: #fef4f4;
    border-bottom: 1px solid #fde;
}
.pin-progress-bar {
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #E60023, #ff6b6b);
    border-radius: 3px;
    flex: 1;
    transition: width 0.5s ease;
    position: relative;
}
.pin-progress-bar::after {
    content: '';
    position: absolute;
    right: 0; top: -2px;
    width: 7px; height: 7px;
    background: #E60023;
    border-radius: 50%;
    animation: pinPulse 1s infinite;
}
@keyframes pinPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}
#pinProgressText {
    font-size: 12px;
    color: #E60023;
    font-weight: 500;
    white-space: nowrap;
}

/* ═══ VIEWER LOADING ═══ */
.pin-viewer-placeholder {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: none;
    opacity: 0.6;
}
.pin-viewer-loading {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}
.pin-viewer-media {
    position: relative;
}
.pin-no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, #1a1a1a, #333);
}
