/*
Theme Name: Social Platform
Theme URI: https://yourdomain.com
Description: Mobile-first Social Platform theme for V3 Blueprint. Phase 2: Full Reels Viewer + Valid View UI.
Author: Your Name
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
Text Domain: socialplatform
*/

:root {
    --sp-primary: #000000;
    --sp-bg: #ffffff;
    --sp-text: #111111;
    --sp-border: #e5e5e5;
    --sp-bottom-nav-height: 56px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--sp-bg);
    color: var(--sp-text);
    line-height: 1.5;
    padding-bottom: var(--sp-bottom-nav-height);
}

.sp-top-header {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--sp-border);
}
.sp-logo { font-weight: 700; font-size: 18px; }
.sp-header-actions { display: flex; gap: 16px; align-items: center; }

.sp-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--sp-bottom-nav-height); background: #fff;
    border-top: 1px solid var(--sp-border);
    display: flex; justify-content: space-around; align-items: center; z-index: 100;
}
.sp-bottom-nav a {
    display: flex; flex-direction: column; align-items: center;
    text-decoration: none; color: #666; font-size: 11px;
}
.sp-bottom-nav a.active { color: var(--sp-primary); }
.sp-bottom-nav .icon { font-size: 22px; margin-bottom: 2px; }

.sp-feed { max-width: 600px; margin: 0 auto; }
.sp-feed-item { border-bottom: 8px solid #f0f0f0; padding-bottom: 12px; }
.sp-feed-item-header { display: flex; align-items: center; padding: 12px 16px; gap: 10px; }
.sp-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #ddd; }
.sp-media { width: 100%; display: block; background: #000; }
.sp-feed-actions { display: flex; gap: 16px; padding: 10px 16px; }
.sp-feed-caption { padding: 0 16px 8px; font-size: 14px; }

.sp-stories {
    display: flex; gap: 12px; padding: 12px 16px;
    overflow-x: auto; border-bottom: 1px solid var(--sp-border);
}
.sp-story-item { flex-shrink: 0; text-align: center; width: 70px; }
.sp-story-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    border: 2px solid #e1306c; padding: 2px; object-fit: cover;
}

/* REELS VIEWER */
.sp-reels-page {
    position: fixed; inset: 0; background: #000; z-index: 300;
    overflow: hidden; touch-action: none;
}
.sp-reels-container { height: 100%; width: 100%; position: relative; }
.sp-reel-slide {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
}
.sp-reel-video {
    width: 100%; height: 100%; object-fit: contain; background: #000;
}
.sp-reels-overlay-right {
    position: absolute; right: 12px; bottom: 100px;
    display: flex; flex-direction: column; gap: 22px;
    color: #fff; text-align: center; z-index: 10;
}
.sp-reels-overlay-right button {
    background: none; border: none; color: #fff; font-size: 28px; cursor: pointer;
}
.sp-reels-overlay-right span { font-size: 12px; display: block; margin-top: 2px; }
.sp-reels-info {
    position: absolute; left: 16px; bottom: 100px;
    color: #fff; max-width: 70%; z-index: 10;
}
.sp-reels-info .username { font-weight: 700; margin-bottom: 4px; }
.sp-reels-info .desc { font-size: 14px; opacity: 0.95; }

.sp-valid-timer {
    position: absolute; top: 20px; right: 16px; z-index: 20;
    width: 52px; height: 52px;
}
.sp-valid-timer svg { transform: rotate(-90deg); }
.sp-valid-timer circle { fill: none; stroke-width: 4; }
.sp-valid-timer .bg { stroke: rgba(255,255,255,0.3); }
.sp-valid-timer .progress { stroke: #00ff88; stroke-linecap: round; transition: stroke-dashoffset 0.2s; }
.sp-valid-timer .text {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px; font-weight: 700;
}
.sp-valid-done {
    position: absolute; top: 20px; right: 16px; z-index: 20;
    background: #00ff88; color: #000; padding: 6px 12px;
    border-radius: 20px; font-weight: 700; font-size: 13px;
    display: none;
}
.sp-reels-close {
    position: absolute; top: 16px; left: 16px; z-index: 20;
    background: rgba(0,0,0,0.5); border: none; color: #fff;
    width: 36px; height: 36px; border-radius: 50%; font-size: 20px; cursor: pointer;
}

@media (min-width: 768px) {
    body { padding-bottom: 0; }
    .sp-bottom-nav { display: none; }
}


/* Full mobile app shell — no external chrome */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: #fff;
    -webkit-tap-highlight-color: transparent;
}
body {
    padding-bottom: 64px;
}
#wpadminbar { display: none !important; }
html.wp-toolbar { padding-top: 0 !important; }

.sp-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    z-index: 9999;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.sp-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #8e8e8e;
    font-size: 10px;
    gap: 2px;
}
.sp-bottom-nav a.active,
.sp-bottom-nav a:hover { color: #000; }
.sp-bottom-nav .icon { font-size: 20px; line-height: 1; }

.sp-header, header.sp-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #eee;
}
