@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* === ANIMALS PICTURE - TEMA X / INSTAGRAM === */

:root {
    --bg: #000000;
    --card: #000000;
    --text: #e7e9ea;
    --border: #2f3336;
    --green: #1d9bf0;
    --red: #f91880;
    --gold: #FFD700;
    --input-bg: #202327;
    --transition-speed: 0.2s;
    --glass-bg: rgba(0, 0, 0, 0.75);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body.light-theme {
    --bg: #ffffff;
    --card: #ffffff;
    --text: #0f1419;
    --border: #eff3f4;
    --input-bg: #eff3f4;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* === APP LAYOUT === */
.app-layout {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
}

.left-sidebar, .right-sidebar { display: none; }

.main-column {
    width: 100%;
    max-width: 600px;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    min-height: 100vh;
    padding-bottom: 70px; /* espaco mobile nav */
}

/* === HEADER MOBILE === */
.mobile-header {
    width: 100%;
    height: 60px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    border-top: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo { font-size: 20px; font-weight: 800; color: var(--text); margin: 0; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.logo-img { width: 32px; height: 32px; border-radius: 50%; }
.logo span { color: var(--green); }

.search-container { flex: 1; max-width: 200px; margin: 0 10px; position: relative; }
.search-input { width: 100%; padding: 8px 16px 8px 36px; border-radius: 20px; border: none; background: var(--input-bg); color: var(--text); margin: 0; font-size: 14px; outline: none; transition: 0.2s; }
.search-input:focus { border: 1px solid var(--green); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 16px; opacity: 0.5; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.btn-icon { background: transparent; border: none; color: var(--text); font-size: 20px; cursor: pointer; padding: 6px; border-radius: 50%; transition: var(--transition-speed); display: flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: rgba(128,128,128,0.2); }
.user-mini img { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; object-fit: cover; border: 1px solid var(--border); }

/* === NAVEGAÇÃO MOBILE (BOTTOM NAV) === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}
.nav-item { background: none; border: none; color: #71767b; padding: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.nav-item span { font-size: 28px; transition: transform 0.2s; }
.nav-item.active { color: var(--text); }
.nav-item.active span { font-variation-settings: 'FILL' 1; }
.nav-item:active span { transform: scale(0.9); }
.nav-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }

/* === TÓPICOS === */
.topic-bar { width: 100%; background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); display: flex; gap: 15px; padding: 12px 16px; overflow-x: auto; position: sticky; top: 60px; z-index: 90; scrollbar-width: none; }
.topic-bar::-webkit-scrollbar { display: none; }
.topic-btn { background: transparent; border: none; color: #71767b; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap; padding: 0 0 5px 0; position: relative; font-family: inherit; transition: color 0.2s; }
.topic-btn:hover { color: var(--text); }
.topic-btn.active { color: var(--text); font-weight: 700; }
.topic-btn.active::after { content: ''; position: absolute; bottom: -8px; left: 0; width: 100%; height: 4px; background: var(--green); border-radius: 4px 4px 0 0; }

/* === STORIES / DESTAQUES === */
.stories-container { display: flex; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.stories-container::-webkit-scrollbar { display: none; }
.story-item { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; min-width: 65px; }
.story-avatar-wrap { width: 60px; height: 60px; border-radius: 50%; padding: 2px; background: linear-gradient(45deg, var(--gold), var(--red)); display: flex; align-items: center; justify-content: center; transition: transform 0.2s; }
.story-avatar-wrap img { width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--bg); object-fit: cover; }
.story-item:hover .story-avatar-wrap { transform: scale(1.05); }
.story-item.create-story .story-avatar-wrap { background: var(--border); border: 1px dashed #71767b; color: var(--text); }
.story-item.create-story .story-avatar-wrap span { font-size: 30px; }
.story-item span { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 65px; text-align: center; }

/* === CORPO E CARDS === */
.sort-bar { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 16px 0; }
.sort-select { background: transparent; border: 1px solid var(--border); border-radius: 20px; padding: 4px 10px; width: auto; font-size: 13px; margin: 0; outline: none; color: var(--text); cursor: pointer; }
.card { background: var(--card); border: none; border-bottom: 1px solid var(--border); padding: 16px; margin-bottom: 0; }
.static-content { border-bottom: 1px solid var(--border); padding: 16px; }

/* === POSTS === */
.post { padding: 16px; border-bottom: 1px solid var(--border); animation: fadeIn 0.4s ease; }
.post p { margin: 12px 0; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.post img { width: 100%; border-radius: 16px; margin-top: 5px; border: 1px solid var(--border); object-fit: cover; max-height: 600px; transition: transform 0.3s ease; }
.post img:hover { transform: scale(1.01); }
.post-header { display: flex; align-items: center; justify-content: space-between; }
.post-user { display: flex; align-items: center; gap: 10px; }
.post-user b { font-size: 15px; }
.post-user span { color: #71767b; font-size: 14px; }
.post-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.badge-admin { background: var(--green); color: white; font-size: 10px; padding: 2px 4px; border-radius: 4px; font-weight: bold; margin-left: 5px; }

/* AÇÕES DO POST */
.post-actions-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; max-width: 425px; padding-top: 5px; }
.action-btn { background: transparent; border: none; color: #71767b; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 8px; border-radius: 50px; transition: 0.2s; }
.action-btn span { font-size: 20px; }
.action-btn:hover { background: rgba(29, 155, 240, 0.1); color: var(--green); }
.btn-like:hover { background: rgba(249, 24, 128, 0.1); color: var(--red); }
.btn-like.liked { color: var(--red); animation: heartBoom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.btn-like.liked span { font-variation-settings: 'FILL' 1; }
.btn-delete:hover { background: rgba(249, 24, 128, 0.1); color: var(--red); }

/* INPUTS E BOTÕES */
input, textarea, select { width: 100%; background: var(--input-bg); border: 1px solid transparent; color: var(--text); padding: 12px 16px; border-radius: 12px; margin: 8px 0; font-family: inherit; font-size: 15px; outline: none; transition: 0.2s; }
input:focus, textarea:focus { border: 1px solid var(--green); background: var(--bg); }
.btn-green { width: 100%; background: var(--text); color: var(--bg); border: none; padding: 12px; border-radius: 30px; font-weight: 700; cursor: pointer; margin-top: 10px; font-size: 15px; transition: 0.2s; }
.btn-green:hover { filter: brightness(0.9); transform: translateY(-1px); }
.btn-load-more { width: 100%; background: transparent; color: var(--green); border: none; padding: 16px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.btn-load-more:hover { background: rgba(29, 155, 240, 0.1); }

.file-upload-label { display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(29, 155, 240, 0.05); border: 1px dashed var(--green); padding: 20px; border-radius: 16px; cursor: pointer; color: var(--green); font-weight:600; font-size: 15px; margin: 15px 0; transition: 0.2s; }
.file-upload-label:hover { background: rgba(29, 155, 240, 0.1); }
#previewUpload { width: 100%; border-radius: 16px; margin-top: 10px; border: 1px solid var(--border); display: none; }

/* COMENTÁRIOS */
.post-comments { margin-top: 12px; }
.comment-item { display: flex; gap: 10px; margin-top: 12px; font-size: 14px; }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.comment-text { color: var(--text); background: var(--input-bg); padding: 8px 12px; border-radius: 16px; border-top-left-radius: 4px; display: inline-block; max-width: 85%; }
.comment-text strong { display: block; margin-bottom: 2px; font-size: 13px; }
.comment-input { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.comment-input input { border-radius: 20px; margin: 0; padding: 10px 16px; }

/* MODAIS */
.modal-bg { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); z-index: 2000; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.modal-bg.open { display: flex; opacity: 1; }
.modal-box { background: var(--bg); width: 90%; max-width: 400px; padding: 25px; border-radius: 20px; position: relative; border: 1px solid var(--border); box-shadow: 0 10px 25px rgba(0,0,0,0.5); transform: translateY(20px) scale(0.95); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.modal-bg.open .modal-box { transform: translateY(0) scale(1); }
.close-btn { position: absolute; top: 12px; left: 12px; background: rgba(128,128,128,0.2); border: none; font-size: 20px; color: var(--text); cursor: pointer; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.close-btn:hover { background: rgba(128,128,128,0.4); }

.config-section { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--border); }
.config-section h4 { margin: 0 0 10px 0; font-size: 15px; color: #71767b; }

/* === ANIMAÇÕES === */
@keyframes heartBoom {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === DESKTOP LAYOUT (3 columns) === */
@media (min-width: 1024px) {
    .app-layout {
        max-width: 1200px;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .mobile-header { display: none; }
    .bottom-nav { display: none; }
    .main-column { padding-bottom: 0; min-width: 600px; max-width: 600px; }
    
    .topic-bar { top: 0; padding-top: 16px; border-bottom: 1px solid var(--border); }
    
    /* LEFT SIDEBAR */
    .left-sidebar {
        display: flex;
        flex-direction: column;
        width: 275px;
        height: 100vh;
        position: sticky;
        top: 0;
        padding: 16px 20px;
    }
    .desktop-logo { padding: 12px; margin-bottom: 12px; width: fit-content; border-radius: 50px; transition: 0.2s; }
    .desktop-logo:hover { background: rgba(29, 155, 240, 0.1); }
    
    .desktop-nav { display: flex; flex-direction: column; gap: 8px; }
    .nav-item-desk { background: transparent; border: none; color: var(--text); font-size: 20px; cursor: pointer; display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 50px; transition: 0.2s; width: fit-content; text-decoration: none; }
    .nav-item-desk:hover { background: rgba(255,255,255,0.1); }
    body.light-theme .nav-item-desk:hover { background: rgba(0,0,0,0.05); }
    .nav-item-desk span.material-symbols-rounded { font-size: 28px; transition: transform 0.2s; }
    .nav-item-desk.active { font-weight: 700; }
    .nav-item-desk.active span.material-symbols-rounded { font-variation-settings: 'FILL' 1; }
    
    .btn-post-desk { width: 90%; padding: 16px; font-size: 17px; margin-top: 20px; border-radius: 50px; }
    
    /* RIGHT SIDEBAR */
    .right-sidebar {
        display: flex;
        flex-direction: column;
        width: 350px;
        margin-left: 20px;
        padding: 12px 0;
        position: sticky;
        top: 0;
        height: 100vh;
    }
    .desktop-search { margin-bottom: 20px; }
    .desktop-search .search-input { background: var(--input-bg); padding: 12px 16px 12px 45px; border-radius: 30px; }
    
    .premium-card, .trending-card {
        background: var(--input-bg);
        border-radius: 16px;
        padding: 16px;
        margin-bottom: 16px;
        border: 1px solid var(--border);
    }
    .premium-card h3, .trending-card h3 { margin: 0 0 10px 0; font-size: 18px; font-weight: 800; }
    .premium-card p { font-size: 14px; color: #71767b; line-height: 1.4; margin-bottom: 12px; }
    
    .trend-item { padding: 12px 0; cursor: pointer; transition: 0.2s; }
    .trend-item:not(:last-child) { border-bottom: 1px solid var(--border); }
    .trend-item:hover { opacity: 0.8; }
    .trend-category { color: #71767b; font-size: 12px; margin: 0; }
    .trend-title { font-weight: 700; font-size: 15px; margin: 2px 0; color: var(--text); }
    .trend-stats { color: #71767b; font-size: 12px; margin: 0; }
    
    .desktop-footer {
        padding: 0 16px;
        font-size: 13px;
        color: #71767b;
    }
    .desktop-footer p { margin: 5px 0; }
    .theme-toggle { padding: 8px 12px; border-radius: 50px; background: var(--input-bg); transition: 0.2s; width: fit-content; border: 1px solid var(--border); }
    .theme-toggle:hover { background: rgba(29, 155, 240, 0.1); }
}

@media (max-width: 1024px) and (min-width: 601px) {
    .app-layout { justify-content: center; max-width: 600px; margin: 0 auto; }
    .left-sidebar, .right-sidebar { display: none !important; }
}

@media (max-width: 600px) {
    .app-layout { align-items: center; }
    .left-sidebar, .right-sidebar { display: none !important; }
    .main-column { border: none; }
}