/*
Theme Name: Fintok Theme
Theme URI: https://example.com/fintok-theme
Author: Antigravity
Author URI: https://example.com
Description: A mobile-first, single-post view theme similar to Inshorts.
Version: 1.5
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fintok
*/

:root {
    --color-bg: #1a1a1a;
    --color-text: #e0e0e0;
    --color-card-bg: #2d2d2d;
    --color-accent: #ff4757;
    --font-heading: 'Ramabhadra', sans-serif;
    --font-body: 'Tenali Ramakrishna', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body,
html {
    height: 100%;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 19px;
    line-height: 1.6;
    overflow: hidden;
}

/* Scroll Snap Container */
.app-container {
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.app-container::-webkit-scrollbar {
    display: none;
}

/* Individual Post Card */
.post-card {
    height: 100vh;
    height: 100dvh;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--color-card-bg);
    overflow: hidden;
    perspective: 1000px;
}

/* Image Section */
.post-image {
    height: 40%;
    width: 100%;
    position: relative;
    background-color: #000;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
    color: #555;
    font-family: var(--font-body);
}

/* Content Section */
.post-content {
    height: 60%;
    padding: 24px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, #2b2b2b, #1f1f1f);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    margin-top: -20px;
    z-index: 10;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);

    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-card.in-view .post-content {
    opacity: 1;
    transform: translateY(0);
}

.post-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    line-height: 1.3;
    margin-bottom: 12px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.post-body {
    font-family: var(--font-body);
    font-size: 1.15rem;
    color: #d1d1d1;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
}

/* Interaction Bar (Fixed Footer) */
.interaction-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5vh;
    min-height: 48px;
    /* Touch friendly minimum */
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 10px;
    background: #000;
    /* Solid black or dark theme bg */
    z-index: 1000;
    /* High enough to be above posts but below overlay */
    border-top: 1px solid rgba(255, 255, 255, 0.1);

    opacity: 1 !important;
    /* Always visible */
    pointer-events: auto !important;
    transform: none !important;
}

/* Show State override - not needed anymore as it's always visible, 
   but keeping cleanup style just in case JS tries to toggle class */
.post-card.show-controls .interaction-bar {
    opacity: 1;
    transform: none;
}

.interaction-bar:hover {
    pointer-events: auto;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 1.5rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    text-decoration: none;
    /* For links */
}

/* Header Menu Button (Top Right) */
.header-menu-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 2005;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 8px;
    color: #fff;
    backdrop-filter: blur(5px);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

/* New Posts Pill (Twitter Style) */
.new-posts-pill {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    /* Hidden up top */
    background: #1da1f2;
    /* Twitter Blue */
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 2004;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 5px;
}

.new-posts-pill.visible {
    transform: translateX(-50%) translateY(0);
}

/* Comment Threading */
.comment-item {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.comment-item.is-reply {
    margin-top: -5px;
    /* Visual grouping */
}

/* Footer Typography Fix */
.interaction-bar .count {
    font-size: 0.75rem;
    margin-left: 5px;
    font-weight: 500;
}

.icon-btn:hover,
.icon-btn:active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-accent);
    transform: scale(1.1);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Category Menu Overlay */
.category-menu {
    position: fixed;
    bottom: 0px;
    left: 0;
    width: 100%;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(15px);
    z-index: 100;
    padding: 20px 20px 40px 20px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    color: white;
}

.category-menu.active {
    transform: translateY(0);
}

.category-menu h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.menu-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.menu-list li a {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
    border-radius: 24px;
    font-size: 0.95rem;
    transition: background 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-list li a:active,
.menu-list li a:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

/* Remove default Nav Arrows if any left */
.nav-hint,
.nav-arrows {
    display: none;
}

/* Desktop Media Query */
@media (min-width: 768px) {
    .app-container {
        max-width: 480px;
        margin: 0 auto;
        border-left: 1px solid #333;
        border-right: 1px solid #333;
    }

    .category-menu {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%) translateY(100%);
    }

    .category-menu.active {
        transform: translateX(-50%) translateY(0);
    }
}

/* Ad Wrapper */
.ad-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--color-card-bg);
}

.ad-wrapper .ad-content {
    width: 100%;
    max-width: 100%;
}

/* Reaction Counts */
.reaction-btn .count {
    font-size: 0.75rem;
    margin-left: 4px;
    font-family: var(--font-body);
    vertical-align: middle;
}

/* Comment Form Styles (Basic Dark Theme Support) */
#comments {
    color: #eee;
    font-size: 0.95rem;
}

.comment-list {
    list-style: none;
    margin-bottom: 30px;
}

.comment-body {
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 8px;
}

.comment-meta {
    margin-bottom: 5px;
    font-size: 0.85rem;
    color: #aaa;
}

.comment-author cite {
    font-style: normal;
    font-weight: bold;
    color: #fff;
}

.comment-form textarea {
    width: 100%;
    background: #333;
    border: 1px solid #444;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
}


/* ... existing code ... */

/* Comment Overlay (Redesign) */
.comments-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    /* Light bg as per image */
    z-index: 2000;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    color: #000;
}

@media (min-width: 768px) {
    .comments-overlay {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%) translateY(100%);
    }

    .comments-overlay.active {
        transform: translateX(-50%) translateY(0);
    }
}

.comments-overlay.active {
    transform: translateY(0);
}

/* Overlay Header */
.comments-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.comments-header .back-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    margin-right: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.comments-header h3 {
    font-family: var(--font-body);
    /* Or system font to match image */
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.comments-header .toggle-switch {
    /* Placeholder for the toggle in image, if needed */
}

/* Comment List */
.comments-scroll-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
}

.comment-item {
    display: flex;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.comment-content {
    flex-grow: 1;
}

.comment-author-name {
    font-weight: bold;
    font-size: 0.95rem;
    color: #000;
    margin-bottom: 2px;
    display: block;
}

.comment-location {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 8px;
    display: block;
}

.comment-text {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #333;
    margin-bottom: 10px;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.8rem;
    color: #777;
}

.comment-time {
    margin-right: auto;
}

.action-link {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

/* Comment Input Area - Full Form */
.comment-input-area {
    background: #fff;
    border-top: 1px solid #eee;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.comment-input-row {
    display: flex;
    gap: 10px;
}

.comment-form-input {
    background: #f0f2f5;
    border: 1px solid transparent;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
    width: 100%;
}

.comment-form-input:focus {
    background: #fff;
    border-color: var(--color-accent);
    outline: none;
}

.comment-submit-btn {
    background: var(--color-accent);
    color: #fff;
    border: none;
    padding: 0 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

.comment-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.replying-to-banner {
    background: #eee;
    padding: 5px 10px;
    font-size: 0.8rem;
    color: #555;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: space-between;
}

.replying-to-banner button {
    background: none;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    color: #999;
}

.reaction-dock {
    display: flex;
    gap: 10px;
    padding: 10px;
    justify-content: space-around;
    border-top: 1px solid #eee;
    background: #fff;
}