/* =============================================
   Barify Theme — Mobile-first Dark Theme
   ============================================= */

:root {
    --bg-dark: #0a0a0f;
    --bg-card: #14141a;
    --bg-surface: #1c1c24;
    --bg-hover: #24242e;
    --accent: #d4a137;
    --accent-dim: #8a6a2a;
    --text: #e8e4dd;
    --text-bright: #ffffff;
    --text-dim: #6e6a74;
    --border: #25252d;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
    --max-width: 600px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    background: var(--bg-dark);
}

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    opacity: 0.8;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Layout --- */
.site-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Header --- */
.site-header {
    padding: 20px 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.site-brand {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-bright);
    text-decoration: none;
}

.site-brand:hover {
    opacity: 1;
}

/* --- Main content --- */
.site-main {
    flex: 1;
    padding-bottom: 40px;
}

/* --- View Tabs --- */
.view-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0 0;
}

.view-tab {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dim);
    background: transparent;
    border: 1.5px solid var(--accent-dim);
    border-radius: 100px;
    transition: all 0.25s;
    text-decoration: none;
    white-space: nowrap;
}

.view-tab:hover {
    color: var(--accent);
    border-color: var(--accent);
    opacity: 1;
}

.view-tab.active {
    background: var(--accent);
    color: #0a0a0f;
    border-color: var(--accent);
    font-weight: 600;
}

/* --- Search --- */
.search-bar {
    margin: 20px 0;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 16px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.search-bar input::placeholder {
    color: var(--text-dim);
}

.search-bar input:focus {
    border-color: var(--accent);
}

/* --- Bar Cards --- */
.bar-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

.bar-card:hover {
    border-color: var(--accent-dim);
}

.bar-card-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--bg-surface);
    cursor: pointer;
}

.bar-card-body {
    padding: 14px 16px;
}

.bar-card-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 4px;
}

.bar-card-meta {
    font-size: 13px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-card-meta .cheers {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

/* --- Bar Detail Page --- */
.bar-header {
    padding: 20px 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.bar-header-name {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 4px;
}

.bar-header-meta {
    font-size: 14px;
    color: var(--text-dim);
}

.bar-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 14px;
    margin-bottom: 12px;
    padding: 6px 0;
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font);
}

.bar-back::before {
    content: '←';
    font-size: 16px;
}

/* --- Post / Vibe Card --- */
.vibe-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.vibe-card-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    background: var(--bg-surface);
    cursor: pointer;
}

.vibe-card-body {
    padding: 12px 16px 14px;
}

.vibe-card-comment {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.vibe-card-comment:empty {
    display: none;
}

.vibe-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-dim);
}

.vibe-card-footer .cheers {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    color: var(--accent);
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.2s;
}

.vibe-card-footer .cheers:hover {
    background: var(--bg-hover);
}

.vibe-card-footer .cheers-active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--text-bright);
}

.vibe-card-footer .time {
    font-size: 12px;
}

/* --- Ad Placeholders (Desktop only) --- */
.ad-slot {
    display: none;
}

@media (min-width: 768px) {
    .site-wrapper {
        max-width: 720px;
    }

    .ad-slot {
        display: flex;
        margin: 20px 0;
        padding: 20px 16px;
        background: var(--bg-surface);
        border: 1px dashed var(--border);
        border-radius: var(--radius);
        align-items: center;
        justify-content: center;
        text-align: center;
        min-height: 120px;
        color: var(--text-dim);
        font-size: 12px;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        user-select: none;
    }
    .ad-slot::before {
        content: '— Ad Space —';
        opacity: 0.5;
    }
    .ad-slot-banner {
        min-height: 80px;
    }
    .ad-slot-skyscraper {
        min-height: 250px;
    }
}

/* =============================================
   Photo Detail Modal
   ============================================= */

.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: flex-end;
    justify-content: center;
}

.photo-modal.open {
    display: flex !important;
}

.photo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.photo-modal-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

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

.photo-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.photo-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.photo-modal-image-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 0;
    flex-shrink: 0;
}

.photo-modal-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 65vh;
    object-fit: contain;
}

.photo-modal-meta {
    background: var(--bg-card);
    padding: 16px 20px 20px;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

.photo-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.photo-modal-bar {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.photo-modal-barname {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-bright);
}

.photo-modal-user {
    font-size: 13px;
    color: var(--text-dim);
}

.photo-modal-date {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
}

.photo-modal-comment {
    font-size: 15px;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 12px;
    padding: 8px 0;
}

.photo-modal-comment:empty {
    display: none;
}

.photo-modal-footer {
    display: flex;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.photo-modal-footer .cheers {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 16px;
    color: var(--accent);
    font-size: 15px;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.2s;
}

.photo-modal-footer .cheers:hover {
    background: var(--bg-hover);
}

.photo-modal-footer .cheers-active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--text-bright);
}

@media (min-width: 768px) {
    .photo-modal {
        align-items: center;
    }

    .photo-modal-container {
        max-width: 600px;
        border-radius: 16px;
        overflow: hidden;
        max-height: 90vh;
    }

    .photo-modal-image-wrap {
        max-height: 70vh;
    }

    .photo-modal-meta {
        border-radius: 0;
    }
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.empty-state-text {
    font-size: 16px;
    line-height: 1.6;
}

/* --- CTA Section --- */
.cta-section {
    text-align: center;
    padding: 40px 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border);
}

.cta-section p {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 16px;
    line-height: 1.6;
}

.cta-button {
    display: inline-block;
    padding: 12px 28px;
    background: var(--accent);
    color: #0a0a0f;
    font-weight: 600;
    font-size: 16px;
    border-radius: 100px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.cta-button:hover {
    opacity: 0.9;
    color: #0a0a0f;
}

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 24px 0;
    font-size: 12px;
    color: var(--text-dim);
    border-top: 1px solid var(--border);
}

.site-footer a {
    color: var(--text-dim);
}

/* --- 404 --- */
.page-404 {
    text-align: center;
    padding: 80px 20px;
}

.page-404 h1 {
    font-size: 64px;
    color: var(--accent-dim);
    margin-bottom: 8px;
}

.page-404 p {
    color: var(--text-dim);
    margin-bottom: 24px;
}

/* --- Loading / Skeleton --- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-hover) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

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

.skeleton-image {
    aspect-ratio: 16/9;
    width: 100%;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text-short {
    width: 60%;
    height: 14px;
}

/* --- Barifications Feed (Instagram-style) --- */
.barifications-feed {
    margin-top: 16px;
}

.barification-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.barification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.barification-bar-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-bright);
    text-decoration: none;
}

.barification-bar-name:hover {
    color: var(--accent);
    opacity: 1;
}

.barification-user {
    font-size: 12px;
    color: var(--text-dim);
}

.barification-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    background: var(--bg-surface);
    cursor: pointer;
}

.barification-body {
    padding: 12px 16px 14px;
}

.barification-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.barification-actions .cheers {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 14px;
    color: var(--accent);
    font-size: 14px;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.2s;
}

.barification-actions .cheers:hover {
    background: var(--bg-hover);
}

.barification-time {
    font-size: 12px;
    color: var(--text-dim);
}

.barification-comment {
    font-size: 14px;
    color: var(--text);
    line-height: 1.4;
}

.barification-comment strong {
    font-weight: 600;
    color: var(--text-bright);
    margin-right: 4px;
}

/* --- Google AdSense Ready Container --- */
.ad-container {
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.ad-container ins.adsbygoogle {
    display: block;
}

/* --- Responsive --- */
@media (min-width: 768px) {
    .site-wrapper {
        padding: 0 24px;
    }

    .bar-card {
        display: flex;
        max-height: 180px;
    }

    .bar-card-image {
        width: 180px;
        min-height: 100%;
        aspect-ratio: auto;
    }

    .bar-card-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .site-wrapper {
        max-width: 960px;
        padding: 0 32px;
    }

    .photo-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .barifications-feed {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}
