/* =============================================
   PALLEGRAM — Dark Premium Blue/Cyan Design
   Linear/Vercel Style
   (c) 2026 Palle Systems
   ============================================= */

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

:root {
    /* New Design Tokens — Dark Premium Blue/Cyan */
    --bg:       #060b14;
    --surface:  #0d1520;
    --surface2: #111e2e;
    --surface3: #162033;
    --border:   #1e3a5f;

    --text:     #e8f1ff;
    --muted:    #6b8cad;
    --subtle:   #374d6b;
    --link:     #22d3ee;

    --like:     #f43f5e;
    --p1:       #3b82f6;      /* blue-500 */
    --p2:       #22d3ee;      /* cyan-400 */
    --p3:       #06b6d4;      /* cyan-500 */

    --glow:     rgba(34, 211, 238, 0.15);
    --glass:    rgba(13, 21, 32, 0.7);

    /* Story ring gradient: blue/cyan */
    --story-grad: linear-gradient(135deg, #06b6d4, #3b82f6, #8b5cf6);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; height: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
    min-height: 100%;
    animation: fadeIn 0.4s ease-out;
}

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

/* ── Glassmorphism Core ── */
.glass {
    background: var(--glass);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--border);
}

.glass-premium {
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* ── Admin Specifics ── */
.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-card:hover {
    border-color: var(--subtle);
    background: var(--surface2);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(0,0,0,0.5);
}

.badge-pulse {
    position: relative;
}
.badge-pulse::after {
    content: '';
    position: absolute;
    top: 0; right: 0; width: 8px; height: 8px;
    background: var(--p2);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 211, 238, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}

/* ── Logo Text (animated gradient) ── */
.logo-text {
    background: linear-gradient(135deg, var(--p2), var(--p1), var(--p2));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.75rem;
    animation: logoGrad 3s ease infinite;
    letter-spacing: -0.5px;
}

@keyframes logoGrad {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ── Glass Header (sticky nav top) ── */
.glass-header {
    background: rgba(6, 11, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

/* ── Glass Card (elevated surfaces) ── */
.glass-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ── Story Ring (blue/cyan gradient) ── */
.story-ring {
    background: var(--story-grad);
    padding: 2px;
    border-radius: 50%;
    display: inline-flex;
    flex-shrink: 0;
}

.story-ring-inner {
    background: var(--bg);
    border-radius: 50%;
    padding: 2px;
    display: flex;
}

/* ── Post Component ── */
.post-wrap {
    border-bottom: 1px solid var(--border);
}

/* ── Login Background & Card ── */
.login-bg {
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 40px 24px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ── Inputs ── */
.pg-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    padding: 10px 12px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.pg-input:focus {
    border-color: var(--p2);
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2);
}

.pg-input::placeholder {
    color: var(--muted);
    font-size: 13px;
}

/* ── Buttons ── */
.pg-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--p1), var(--p2));
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.pg-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.pg-btn:active {
    transform: translateY(0);
    opacity: 0.85;
}

/* ── Bottom Navigation Upload Button ── */
.nav-upload-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--p1), var(--p2));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
    box-shadow: 0 4px 12px rgba(34, 211, 238, 0.25);
}

.nav-upload-btn:active {
    transform: scale(0.9);
}

/* ── Nav Icon Wrapper ── */
.nav-icon-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 62px;
    position: relative;
    transition: transform 0.15s ease, background-color 0.2s ease; /* Added background-color transition */
    border-radius: 8px; /* Added for subtle background on hover */
}

.nav-icon-wrap:active {
    transform: scale(0.9);
}

.nav-icon-wrap:hover:not(.nav-active) { /* Only apply hover to inactive items */
    background-color: rgba(255, 255, 255, 0.05); /* Subtle background on hover */
}

/* ── Nav Active State ── */
.nav-active {
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.4); /* Subtle glow for active item */
    background-color: rgba(34, 211, 238, 0.1); /* Slightly more prominent active background */
}

.nav-active .nav-dot {
    opacity: 1;
    background: var(--p2);
}

.nav-dot {
    position: absolute;
    bottom: 6px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: transparent;
    transition: opacity 0.2s, background 0.2s;
}

/* ── Badge / Notification Dot ── */
.dot-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: var(--like);
    border-radius: 50%;
    border: 1.5px solid var(--bg);
}

/* ── Scrollbar ── */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Shimmer (skeleton loading) ── */
.shimmer {
    background: linear-gradient(110deg, var(--surface) 25%, var(--surface2) 45%, var(--surface) 65%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ── Article Reveal (fade-in on scroll) ── */
.article-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.article-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Double-tap Heart ── */
.big-heart {
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    filter: drop-shadow(0 2px 8px rgba(244, 63, 94, 0.8));
    color: var(--like);
}

.animate-heart {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1.2) !important;
}

/* ── Animated Orbs (login background) ── */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: rgba(59, 130, 246, 0.3);
    animation: orbFloat 15s ease-in-out infinite;
}

.orb-2 {
    width: 250px;
    height: 250px;
    background: rgba(34, 211, 238, 0.25);
    animation: orbFloatAlt 18s ease-in-out infinite;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: rgba(139, 92, 246, 0.2);
    animation: orbFloat 20s ease-in-out infinite reverse;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, -30px); }
    50% { transform: translate(-20px, 20px); }
    75% { transform: translate(40px, 10px); }
}

@keyframes orbFloatAlt {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-30px, 30px); }
    50% { transform: translate(20px, -20px); }
    75% { transform: translate(-40px, -10px); }
}

/* ── Floating Particles ── */
.pg-particle {
    position: absolute;
    border-radius: 50%;
    animation: particleFloat 12s infinite ease-in;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(1);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) translateX(100px) scale(0.5);
    }
}

/* ── Safe Area Helpers ── */
.pb-nav {
    padding-bottom: calc(62px + var(--safe-bottom) + 8px);
}

.pt-safe {
    padding-top: calc(var(--safe-top) + 10px);
}

/* ── Bottom Navigation ── */
.ig-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(6, 11, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding-bottom: var(--safe-bottom);
    max-width: 540px;
    margin: 0 auto;
}

.ig-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 62px;
    padding: 0 4px;
}

.ig-nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    transition: transform 0.15s ease;
}

.ig-nav-item:active {
    transform: scale(0.85);
}

.ig-nav-item svg,
.ig-nav-item img {
    display: block;
}

/* ── Post Component ── */
.ig-post {
    border-bottom: 1px solid var(--border);
}

.ig-post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
}

.ig-avatar {
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface2);
    flex-shrink: 0;
}

.ig-media {
    width: 100%;
    background: var(--surface);
    display: block;
    position: relative;
}

.ig-media img,
.ig-media video {
    width: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

.ig-actions {
    padding: 8px 12px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ig-action-group {
    display: flex;
    gap: 16px;
    align-items: center;
}

.ig-action-btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 6px;
    margin: -6px;
    transition: transform 0.15s ease, opacity 0.15s ease;
    display: flex;
    align-items: center;
}

.ig-action-btn:active {
    transform: scale(0.85);
}

.ig-action-btn:hover {
    opacity: 0.6;
}

.ig-meta {
    padding: 0 12px 10px;
}

/* ── Divider ── */
.ig-login-divider {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 18px 0;
}

.ig-login-divider::before,
.ig-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.ig-login-divider span {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 1px;
}

/* ── Follow Button ── */
.ig-follow-btn {
    background: linear-gradient(135deg, var(--p1), var(--p2));
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ig-follow-btn:hover {
    opacity: 0.9;
}

.ig-follow-btn.following {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
}

/* ── Badge Colors ── */
.badge-blue {
    color: var(--p1);
}

.badge-gold {
    color: #fbbf24;
}

/* ── Legacy Instagram Classes (compatibility) ── */
.ig-logo {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--text);
    letter-spacing: -0.5px;
}

.ig-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(6, 11, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding-top: calc(10px + var(--safe-top));
    padding-bottom: 10px;
    padding-left: 16px;
    padding-right: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ig-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--p1), var(--p2));
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
    -webkit-appearance: none;
}

.ig-btn-primary:hover {
    opacity: 0.9;
}

.ig-btn-primary:active {
    opacity: 0.85;
}

.ig-btn-ghost {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.ig-btn-ghost:hover {
    background: var(--surface2);
}

.ig-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    padding: 10px 12px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.ig-input:focus {
    border-color: var(--muted);
}

.ig-input::placeholder {
    color: var(--muted);
    font-size: 13px;
}

.ig-login-wrap {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
}

.ig-login-card {
    width: 100%;
    max-width: 350px;
    border: 1px solid var(--border);
    border-radius: 1px;
    padding: 36px 40px 24px;
    background: var(--bg);
}

.notif-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: var(--like);
    border-radius: 50%;
    border: 1.5px solid var(--bg);
}

/* User's original insta-blur for navigation */
.insta-blur{
    backdrop-filter:blur(20px);
    background:rgba(0,0,0,0.85);
}

:root{
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}
.no-scrollbar::-webkit-scrollbar{display:none;}
.chat-wrap{height:100dvh;} /* better on mobile */

/* Reels Specific Styles */
html.reels-mode, body.reels-mode { background: #000; height: 100vh; overflow: hidden; position: fixed; width: 100%; }
.reels-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
}
.reel-item {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.reel-item video { width: 100%; height: 100%; object-fit: cover; } /* Target video inside reel-item */
.reel-ui {
    position: absolute;
    bottom: calc(85px + var(--safe-bottom));
    left: 0; right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    pointer-events: none;
    z-index: 10;
}
.reel-ui * { pointer-events: auto; }
.reel-actions {
    position: absolute;
    right: 12px;
    bottom: calc(120px + var(--safe-bottom));
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    z-index: 20;
}
.action-item { text-align: center; }
.action-item i { font-size: 32px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.action-label { font-size: 11px; font-weight: 900; margin-top: 4px; }

/* Login Page Specifics */
#login-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#login-overlay img {
    width: 280px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(34, 211, 238, 0.3);
}
