/*
Theme Name: aisesat themes
Theme URI: https://aisesat.com/
Author: Sumanto
Description: A modern social media WordPress theme inspired by Threads and Character.ai.
Version: 1.0.0
Author URI: https://sumanto.com/
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aisesat-themes
Tags: social-media, dark-mode, threads-style, mobile-first
*/

:root {
    --bg-black: #0f0f10;
    --bg-gray: #1a1a1c;
    --card-bg: #1e1e20;
    --text-primary: #f5f5f7;
    --text-secondary: #a0a0ab;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --border-color: #2e2e32;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-black);
    color: var(--text-primary);
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 15px;
}

header {
    background-color: rgba(15, 15, 16, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Feed Layout */
#feed {
    margin-top: 20px;
}

.feed-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    transition: transform 0.2s;
}

.feed-card:hover {
    border-color: #3e3e42;
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-right: 12px;
    background-color: var(--bg-gray);
}

.author-info .name {
    font-weight: 600;
    display: block;
}

.author-info .time {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.post-content {
    font-size: 1rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    margin-bottom: 15px;
}

.post-media {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.post-media img {
    max-width: 100%;
    display: block;
}

.post-actions {
    display: flex;
    gap: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
    padding: 6px 12px;
    border-radius: 9999px;
}

.action-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

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

.composer-buttons button {
    transition: opacity 0.15s ease, background-color 0.15s ease, transform 0.15s ease !important;
}

.composer-buttons button:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.composer-buttons button:active {
    transform: scale(0.96);
}

.hashtag {
    color: var(--accent-purple);
    font-weight: 500;
}

/* Loading state */
#loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

@media (max-width: 600px) {
    .feed-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-bottom: 1px;
    }
}

/* Lazy Loading Fade-in (Global) */
.lazy-load-p {
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.lazy-load-p.loaded {
    opacity: 1;
}

/* Masonry System */
.prompt-masonry-grid {
    column-count: 4;
    column-gap: 20px;
    width: 100%;
}

.prompt-masonry-item {
    break-inside: avoid;
    margin-bottom: 20px;
}

/* Responsive Masonry */
@media (max-width: 1400px) {
    .prompt-masonry-grid {
        column-count: 4;
    }
}

@media (max-width: 1200px) {
    .prompt-masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .prompt-masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .prompt-masonry-grid {
        column-count: 1;
    }
}

/* Card Premium Styles (Full Image Hover) */
.prompt-card-premium {
    display: block;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s, border-color 0.3s;
    position: relative;
    color: inherit;
}

.prompt-card-premium:hover {
    transform: translateY(-5px);
    border-color: #3f3f46;
}

.card-media-p {
    position: relative;
    overflow: hidden;
    background: #18181b;
    border-radius: 12px;
    aspect-ratio: 4/5;
}

/* Skeleton Loading Shimmer */
.card-media-p::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #18181b 0%, #27272a 50%, #18181b 100%);
    background-size: 200% 100%;
    animation: placeholder-shimmer 1.5s infinite linear;
    z-index: 0;
}

/* SVG Loading Spinner */
.card-media-p::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background-image: url("data:image/svg+xml,%3Csvg width='38' height='38' viewBox='0 0 38 38' xmlns='http://www.w3.org/2000/svg' stroke='%233b82f6'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg transform='translate(1 1)' stroke-width='3'%3E%3Ccircle stroke-opacity='.3' cx='18' cy='18' r='18'/%3E%3Cpath d='M36 18c0-9.94-8.06-18-18-18'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 18 18' to='360 18 18' dur='1s' repeatCount='indefinite'/%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 1;
}

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

    100% {
        background-position: -200% 0;
    }
}

.card-media-p img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    transition: transform 0.5s ease;
}

/* The global lazy load fade handles opacity. When loaded, opacity becomes 1. 
   We add a transition override combining transform scaling and opacity overlaying */
.prompt-card-premium:hover .card-media-p img {
    transform: scale(1.05);
}

.media-placeholder-p {
    background: #27272a;
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
}

.card-badges-p {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 5;
}

.card-badges-p .badge {
    background: rgba(0, 0, 0, 0.7);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
}

.badge.premium {
    color: #fbbf24;
}

.badge.member {
    color: #60a5fa;
}

.card-overlay-p {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 40%, transparent 85%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    z-index: 2;
}

.prompt-card-premium:hover .card-overlay-p {
    opacity: 1;
}

.overlay-content-p {
    width: 100%;
}

.card-title-p {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.overlay-footer-p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.overlay-stats-p {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: #fff;
    font-weight: 600;
}

.overlay-stats-p span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-model-p {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #000;
    background: #f4f4f5;
    padding: 4px 10px;
    border-radius: 99px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* ==========================================================================
   Single Prompt Redesign (Hero Layout)
   ========================================================================== */
.prompt-hero-section {
    position: relative;
    width: 100%;
    height: 870px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.prompt-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.prompt-hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #0d0e10 0%, rgba(13, 14, 16, 0.2) 60%, transparent 100%);
    z-index: 1;
}

.prompt-hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 0 2rem 4rem 2rem;
    max-width: 1280px;
    margin: 0 auto;
}

.prompt-hero-top {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 768px) {
    .prompt-hero-top {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

.prompt-hero-title {
    font-family: 'Manrope', sans-serif;
    font-size: 1.75rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 1.5rem;
    color: #fdfbfe;
}

@media (min-width: 768px) {
    .prompt-hero-title {
        font-size: 3rem;
    }
}

.btn-view-image-mobile {
    display: flex;
}

@media (min-width: 768px) {
    .btn-view-image-mobile {
        display: none !important;
    }
}

.prompt-hero-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.prompt-hero-model {
    background: rgba(133, 173, 255, 0.4);
    color: #d1e0ff;
    border: 1px solid rgba(133, 173, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.prompt-hero-time {
    color: #ababad;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prompt-glass-panel {
    background: rgba(36, 38, 41, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(71, 72, 74, 0.2);
    max-width: 48rem;
}

.prompt-glass-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.prompt-glass-text {
    font-size: 1.125rem;
    color: #fdfbfe;
    line-height: 1.625;
}

.prompt-copy-btn {
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: #181a1c;
    color: #85adff;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prompt-copy-btn:hover {
    background: #2b2c2f;
}

/* Stat Boxes */
.prompt-stats-group {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    width: 100%;
}

@media (min-width: 768px) {
    .prompt-stats-group {
        flex-direction: column;
        gap: 1rem;
        width: auto;
    }
}

.prompt-stat-box {
    background: rgba(30, 32, 34, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.75rem 0.5rem;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    user-select: none;
    border: 1px solid transparent;
}

.prompt-stat-box:hover {
    background: rgba(43, 44, 47, 0.9);
    transform: translateY(-2px);
}

.prompt-stat-box.liked {
    background: rgba(253, 43, 119, 0.1);
    border-color: rgba(253, 43, 119, 0.3);
}

.prompt-stat-box .stat-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 0.25rem;
}

.prompt-stat-box.like-btn .stat-icon {
    color: #ff6c92;
}

.prompt-stat-box.liked .stat-icon {
    fill: #ff6c92;
    color: #ff6c92;
}

.prompt-stat-box.view-box .stat-icon {
    color: #85adff;
}

.prompt-stat-box .stat-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fdfbfe;
}

.prompt-stat-box .stat-label {
    font-size: 0.55rem;
    color: #ababad;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    text-align: center;
}

@media (min-width: 768px) {
    .prompt-stat-box {
        padding: 1rem 1.5rem;
        min-width: 100px;
        flex: none;
    }

    .prompt-stat-box .stat-icon {
        width: 24px;
        height: 24px;
    }

    .prompt-stat-box .stat-number {
        font-size: 1.25rem;
    }

    .prompt-stat-box .stat-label {
        font-size: 0.625rem;
        letter-spacing: -0.05em;
    }
}

/* Body Content Area */
.prompt-content-section {
    padding: 5rem 2rem;
    max-width: 1280px;
    margin: 0 auto;
}

.prompt-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 1024px) {
    .prompt-content-grid {
        grid-template-columns: 8fr 4fr;
    }
}

.prompt-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
}

.prompt-section-title {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.prompt-section-link {
    color: #85adff;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: color 0.2s;
}

.prompt-section-link:hover {
    color: #ff6c92;
}

/* Sidebar Specifics */
.sidebar-random-prompts {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.random-prompt-small {
    display: flex;
    gap: 1rem;
    cursor: pointer;
    text-decoration: none;
    align-items: center;
}

.random-prompt-small .thumb {
    width: 6rem;
    height: 6rem;
    border-radius: 0.75rem;
    overflow: hidden;
    flex-shrink: 0;
    background: #242629;
}

.random-prompt-small .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.random-prompt-small:hover .thumb img {
    transform: scale(1.1);
}

.random-prompt-small .info .model {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #ff6c92;
    margin-bottom: 0.25rem;
    display: block;
}

.random-prompt-small .info h4 {
    font-weight: 700;
    line-height: 1.2;
    color: #fdfbfe;
    transition: color 0.2s;
}

.random-prompt-small:hover .info h4 {
    color: #85adff;
}

.random-prompt-small .info .likes {
    font-size: 0.75rem;
    color: #ababad;
    margin-top: 0.25rem;
}

/* ==========================================================================
   Mobile: sticky header offset fix
   ========================================================================== */
:root {
    --header-h: 160px;
    /* fallback sebelum JS mengukur */
}

/* Single Prompt — hero tidak boleh tertutup sticky header */
@media (max-width: 767px) {
    .prompt-hero-wrapper {
        scroll-margin-top: var(--header-h);
    }

    .prompt-hero-section {
        height: auto;
        min-height: calc(100svh - var(--header-h));
        padding-top: var(--header-h);
    }

    /* Archive heading tidak perlu top-margin besar di mobile */
    .archive-header-simple {
        margin-top: 16px;
    }

    /* Archive container sudah ada gap yang cukup */
    .container-prompt {
        margin-top: 0;
    }
}

/* Character Biography Typography & Spacing Overrides */
.character-content {
    line-height: 1.75;
    color: #d1d1d6;
    font-size: 1.05rem;
}

.character-content p {
    margin-bottom: 1.25rem;
}

.character-content h1,
.character-content h2,
.character-content h3,
.character-content h4,
.character-content h5,
.character-content h6 {
    color: #ffffff;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.character-content h1 { font-size: 2rem; }
.character-content h2 { font-size: 1.6rem; }
.character-content h3 { font-size: 1.35rem; }
.character-content h4 { font-size: 1.15rem; }

.character-content ul,
.character-content ol {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem !important;
}

.character-content ul {
    list-style-type: disc !important;
}

.character-content ol {
    list-style-type: decimal !important;
}

.character-content li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
    display: list-item !important; /* Override any reset display rules */
}

.character-content li strong {
    color: #ffffff;
}