:root {
    --primary: #ff3e00;
    --bg-dark: #0f0f0f;
    --bg-reader: #ffffff;
    --text-dark: #1a1a1a;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-main: #ffffff;
    --text-muted: #cccccc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
}

.shorts-container {
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.shorts-container::-webkit-scrollbar {
    display: none;
}

.post-card {
    height: 100dvh;
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.featured-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    z-index: 1;
}

.header {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    background: rgba(0,0,0,0.3);
    padding: 10px 15px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.logo {
    height: 35px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.content-overlay {
    position: relative;
    z-index: 10;
    padding: 120px 20px 60px;
    background: linear-gradient(transparent, rgba(0,0,0,0.95));
    width: 100%;
}

.content-overlay h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.post-author {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(255,62,0,0.15);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255,62,0,0.3);
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.reader-meta {
    margin-bottom: 24px;
    margin-top: -10px;
}

.reader-meta .post-author {
    color: var(--primary);
    background: rgba(255,62,0,0.08);
}

.reader-meta .post-date {
    color: #666;
}

.content-overlay p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.cta-button {
    display: inline-block;
    padding: 15px 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 40px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 62, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cta-button:hover {
    transform: scale(1.05);
    background: #ff5e00;
}

/* Reader Mode */
.reader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-reader);
    color: var(--text-dark);
    z-index: 100;
    overflow-y: auto;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.reader-header {
    position: sticky;
    top: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    z-index: 110;
}

.close-button {
    background: #f0f0f0;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
}

.logo-small {
    height: 25px;
}

.reader-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px 80px;
}

.reader-featured-image {
    width: 100%;
    max-height: 55vh;
    height: auto;
    object-fit: cover;
    object-position: center 30%;
    display: block;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.reader-content h1 {
    font-size: 2.2rem;
    margin-bottom: 25px;
    line-height: 1.2;
}

.story-body {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #333;
}

.story-body p {
    margin-bottom: 20px;
}

.story-body img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    margin: 16px auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.story-body h1,
.story-body h2,
.story-body h3,
.story-body h4 {
    margin-top: 24px;
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
}

.loading {
    padding: 40px;
    text-align: center;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
}

.category-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 12px;
    background: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.35));
    backdrop-filter: blur(8px);
}

.category-bar::-webkit-scrollbar {
    height: 0;
}

.category-btn {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
}

.category-btn:hover {
    background: rgba(255, 62, 0, 0.9);
    border-color: rgba(255, 62, 0, 1);
}

/* ── Social Action Buttons (Left side, reel-style) ── */
.social-actions {
    position: absolute;
    left: 15px;
    bottom: 300px;
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.action-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                background 0.2s ease,
                box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    -webkit-tap-highlight-color: transparent;
}

.action-btn:hover {
    transform: scale(1.12);
    background: rgba(255, 255, 255, 0.22);
}

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

.like-btn {
    font-size: 1.4rem;
    letter-spacing: 0;
}

.like-btn.liked {
    color: #ff3e3e;
    background: rgba(255, 62, 62, 0.25);
    border-color: rgba(255, 62, 62, 0.5);
    box-shadow: 0 4px 18px rgba(255, 62, 62, 0.45);
    transform: scale(1.08);
}

.comment-btn {
    font-size: 1.3rem;
}

.share-btn {
    font-size: 1.3rem;
}

.action-count {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    font-weight: 700;
    letter-spacing: 0.3px;
    text-align: center;
}

/* ── Reader Footer — Professional Next / Back Buttons ── */
.reader-footer {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 20px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.10);
}

.footer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: none;
    border-radius: 14px;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.25s ease,
                background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-next {
    padding: 18px 28px;
    font-size: 1.1rem;
    letter-spacing: 0.4px;
    background: linear-gradient(135deg, #ff3e00 0%, #ff7b00 100%);
    color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(255, 62, 0, 0.42),
                inset 0 1px 0 rgba(255,255,255,0.25);
    order: -1;
}

.btn-next::after {
    content: ' →';
    font-size: 1.2rem;
}

.btn-next:hover {
    transform: translateY(-2px) scale(1.015);
    box-shadow: 0 12px 32px rgba(255, 62, 0, 0.55),
                inset 0 1px 0 rgba(255,255,255,0.25);
}

.btn-next:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(255, 62, 0, 0.4);
}

.btn-exit {
    padding: 13px 24px;
    font-size: 0.95rem;
    background: transparent;
    color: #777;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
}

.btn-exit:hover {
    background: #f7f7f7;
    border-color: #c8c8c8;
    color: #444;
}

.btn-exit:active {
    background: #efefef;
}

/* ── Ad Cards ── */
.ad-card {
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-feed-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 0 20px;
}

.ad-label {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
}

.ad-mid-article {
    margin: 28px 0;
    text-align: center;
    padding: 4px 0;
}

