/* ARQUIVO: css/style.css (SUPER COMPACTO) */

/* --- ESTILO GERAL --- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }

:root { 
    --green-leaf: #2E7D32; --green-light: #E8F5E9;
    --purple-berry: #8E24AA; --purple-light: #F3E5F5;
    --bg-body: #F0F2F5; --text-main: #1c1e21; --text-sec: #65676b;
    --gold: #FFD700; --silver: #C0C0C0; --bronze: #CD7F32;
    --card-bg: #ffffff; --border-color: #ddd;
}

body.no-scroll { overflow: hidden !important; }

.dark-mode {
    --bg-body: #18191a; --text-main: #e4e6eb; --text-sec: #b0b3b8;
    --card-bg: #242526; --green-light: #2e3b30; --purple-light: #3a2e3b;
    --border-color: #3e4042;
}
.dark-mode .navbar { background: rgba(36, 37, 38, 0.95); border-bottom: 1px solid #3e4042; }
.dark-mode .cp-input, .dark-mode .post-select, .dark-mode .search-bar-social { background: #3a3b3c; color: #e4e6eb; }
.dark-mode .icon-btn { background: #3a3b3c; color: #e4e6eb; }
.dark-mode .suggestion-card, .dark-mode .ranking-item { border-color: #3e4042; background: #2a2b2c; }
.dark-mode .notification-dropdown { background: #242526; border-color: #3e4042; color: #e4e6eb; }
.dark-mode .notif-item:hover { background: #3a3b3c; }
.dark-mode .comment-input { background: #3a3b3c; border-color: #555; color: white; }
.dark-mode .modal-content { background: #242526; color: #e4e6eb; }
.dark-mode .modal-header { border-bottom: 1px solid #3e4042; }
.dark-mode .like-list-item:hover { background: #3a3b3c; }
.dark-mode .filter-dropdown { background: #242526; border-color: #3e4042; }
.dark-mode .topics-grid button { background: #3a3b3c; border-color: #555; color: white; }

/* SCROLL FADE WRAPPER */
.scroll-fade-wrapper { position: relative; width: 100%; }

/* FILTROS */
.filter-bar { display: flex; gap: 8px; width: 100%; padding: 10px 5px; margin-bottom: 8px; overflow-x: auto; }
.filter-bar::-webkit-scrollbar { display: none; }

.filter-btn { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 10px 5px; font-size: 12px; font-weight: bold; color: var(--text-sec); cursor: pointer; transition: 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.05); flex: 1; display: flex; justify-content: center; align-items: center; gap: 5px; min-width: 80px; white-space: nowrap; }
.filter-btn.active { background: var(--purple-light); color: var(--purple-berry); border-color: var(--purple-berry); }
.filter-btn:active { transform: scale(0.95); }

.pc-filter-btn { display: none; } 
.mobile-filter-trigger { display: flex; }
@media (min-width: 900px) { .pc-filter-btn { display: flex; } .mobile-filter-trigger { display: none; } }

/* MENU DE FILTROS SUSPENSO */
.filter-dropdown { position: absolute; top: 55px; right: 5px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 5px 25px rgba(0,0,0,0.3); z-index: 9999 !important; min-width: 180px; overflow: hidden; animation: fadeIn 0.2s; }
.filter-option { padding: 12px 15px; font-size: 13px; font-weight: 600; color: var(--text-main); cursor: pointer; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(0,0,0,0.05); }
.filter-option:hover { background: var(--bg-body); }
.filter-option:last-child { border-bottom: none; }

.access-lock-card { background: var(--card-bg); border-radius: 20px; padding: 40px 20px; text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,0.1); margin-top: 50px; border: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: center; gap: 15px; }
.dark-mode .access-lock-card { background: #242526; border-color: #3e4042; }

.btn-login-redirect { background: linear-gradient(45deg, var(--green-leaf), var(--purple-berry)); color: white; border: none; padding: 12px 30px; border-radius: 30px; font-weight: bold; font-size: 16px; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: transform 0.2s; display: flex; align-items: center; gap: 8px; }
.btn-login-redirect:active { transform: scale(0.95); }

.header-dropdown { position: absolute; top: 60px; right: 10px; width: 300px; background: var(--card-bg); border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.2); border: 1px solid var(--border-color); padding: 10px; display: none; flex-direction: column; gap: 5px; z-index: 2001; animation: fadeIn 0.2s; max-height: 80vh; overflow-y: auto; }
.dark-mode .header-dropdown { background: #242526; border-color: #3e4042; }

.menu-item-drop { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 8px; cursor: pointer; color: var(--text-main); font-size: 13px; font-weight: 600; text-decoration: none; transition: 0.2s; }
.menu-item-drop:hover { background: var(--bg-body); }
.dark-mode .menu-item-drop:hover { background: #3a3b3c; }

body { font-family: 'Poppins', sans-serif; background: var(--bg-body); color: var(--text-main); padding-top: 65px; padding-bottom: 0; min-height: 100vh; overflow-x: hidden; width: 100%; transition: background 0.3s, color 0.3s; }
@media (max-width: 899px) { body { padding-bottom: 70px; } }

img, video { max-width: 100%; height: auto; }

/* NAVBAR */
.navbar { position: fixed; top: 0; left: 0; width: 100%; height: 65px; background: rgba(255,255,255,0.98); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: space-between; padding: 0 15px; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border-bottom: 1px solid rgba(0,0,0,0.05); transition: background 0.3s; }
.logo { font-size: 20px; font-weight: 800; background: linear-gradient(45deg, var(--green-leaf), var(--purple-berry)); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: flex; align-items: center; gap: 5px; min-width: 150px; white-space: nowrap; }
.search-bar-social { display: none; background: #f0f2f5; border-radius: 20px; padding: 0 15px; height: 40px; align-items: center; gap: 10px; color: var(--text-sec); flex: 1; max-width: 550px; margin: 0 20px; transition: 0.3s; }
@media (min-width: 768px) { .search-bar-social { display: flex; } }
.nav-icons { display: flex; gap: 10px; align-items: center; position: relative; min-width: 150px; justify-content: flex-end; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; background: #e4e6eb; display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; color: black; transition: 0.2s; flex-shrink: 0; position: relative; }
.icon-btn:hover { background: var(--purple-light); color: var(--purple-berry); transform: translateY(-2px); }

.desktop-only { display: none !important; }
.mobile-only { display: flex !important; }
@media (min-width: 900px) { .desktop-only { display: flex !important; } .mobile-only { display: none !important; } }

.badge-count { position: absolute; top: 2px; right: 2px; background: #ff3d00; color: white; font-size: 9px; font-weight: 800; padding: 1px 2px; border-radius: 10px; display: none; border: 2px solid var(--card-bg); min-width: 12px; text-align: center; z-index: 10; }
.notification-dropdown { position: absolute; top: 60px; right: -10px; width: 320px; background: white; border-radius: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.2); border: 1px solid var(--border-color); padding: 10px; display: none; flex-direction: column; gap: 5px; z-index: 2000; max-height: 300px; overflow-y: auto; }
@media (max-width: 768px) { .notification-dropdown { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); right: auto; width: 90%; max-width: 350px; } }
.notif-item { display: flex; flex-direction: column; gap: 5px; padding: 10px; border-radius: 8px; transition: 0.2s; cursor: pointer; font-size: 12px; border-bottom: 1px solid rgba(0,0,0,0.05); }
.notif-item:hover { background: #f0f2f5; }

.main-layout { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 1600px; margin: 0 auto; gap: 20px; padding: 10px 10px; }
@media (min-width: 900px) { .main-layout { grid-template-columns: 320px minmax(0, 1fr) 320px; padding: 20px 20px; } }

/* 🔥 STORIES (ALINHAMENTO DAS BOLINHAS - SUPER AJUSTADO) 🔥 */
.stories-wrapper { display: flex; gap: 4px; overflow-x: auto; padding: 2px 5px; scrollbar-width: none; }
.stories-wrapper::-webkit-scrollbar { display: none; }
.story { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 0px; cursor: pointer; flex-shrink: 0; width: 66px; }
.story-name { font-size: 11px; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-align: center; margin-top: -2px; }

/* 🔥 POST CREATOR - AGORA COM MARGEM INFERIOR DE 8PX APENAS 🔥 */
.create-post-card { background: var(--card-bg); border-radius: 15px; padding: 15px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); width: 100%; transition: background 0.3s; }
.cp-top { display: flex; gap: 10px; margin-bottom: 10px; align-items: flex-start; }
.cp-avatar-col { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 50px; }
.cp-input { flex: 1; background: #f0f2f5; border: none; border-radius: 20px; padding: 12px 15px; outline: none; font-family: inherit; font-size: 14px; width: 100%; min-width: 0; transition: 0.3s; resize: none; height: 80px; line-height: 1.4; }
.cp-bottom { border-top: 1px solid var(--border-color); padding-top: 10px; display: flex; align-items: center; gap: 5px; width: 100%; }
.cp-btn { border: none; background: none; display: flex; align-items: center; justify-content: center; gap: 5px; font-weight: 600; color: var(--text-sec); cursor: pointer; padding: 8px 5px; border-radius: 8px; font-size: 12px; flex: 1; }
.cp-btn:hover { background: var(--bg-body); }
.post-select { background: #f0f2f5; border: none; padding: 6px; border-radius: 8px; font-size: 11px; color: var(--text-sec); cursor: pointer; outline: none; font-weight: bold; transition: 0.3s; flex: 1; text-align: center; }
.btn-publish { background: var(--green-leaf); color: white; border: none; padding: 8px 10px; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 12px; box-shadow: 0 2px 5px rgba(46, 125, 50, 0.3); transition: 0.2s; flex: 1.5; display: flex; justify-content: center; align-items: center; }
.btn-publish:hover { transform: scale(1.02); }
.btn-publish:disabled { background: #ccc; transform: none; box-shadow: none; }
@media (max-width: 600px) { .cp-btn span:not(.material-icons-round) { display: none; } .post-select { font-size: 10px; padding: 4px; } }
#image-preview-area { display: none; margin-bottom: 10px; position: relative; }
#preview-img { width: 100%; max-height: 300px; object-fit: contain; border-radius: 10px; background: #222; cursor: pointer; border: 1px solid var(--border-color); }
.remove-img-btn { position: absolute; top: 10px; right: 10px; background: white; border: none; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-weight: bold; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }

/* EDITOR DE IMAGEM */
#editor-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 6000; display: none; flex-direction: column; }
.editor-header { padding: 15px; display: flex; justify-content: space-between; align-items: center; color: white; position: absolute; top: 0; width: 100%; z-index: 10; }
.editor-canvas-container { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
#editor-canvas { max-width: 100%; max-height: 100%; }
.editor-controls { padding: 20px; display: flex; flex-direction: column; gap: 15px; background: rgba(0,0,0,0.8); width: 100%; z-index: 10; position: absolute; bottom: 0; }
.editor-input-row { display: flex; gap: 10px; align-items: center; }
.editor-text-input { flex: 1; background: transparent; border: 1px solid rgba(255,255,255,0.5); color: white; padding: 10px; border-radius: 20px; outline: none; }
.editor-color-picker { width: 35px; height: 35px; border: 2px solid white; border-radius: 50%; padding: 0; overflow: hidden; background: none; cursor: pointer; }
.rotation-controls { display: flex; justify-content: space-around; color: white; font-size: 9px; text-align: center; gap: 5px; }
.range-wrap { display: flex; flex-direction: column; align-items: center; width: 30%; }
input[type=range] { width: 100%; height: 4px; border-radius: 2px; }

/* MODAL CONFIRMAÇÃO STORY DIRETO */
#story-confirm-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 6500; display: none; flex-direction: column; align-items: center; justify-content: center; }
.sc-content { background: var(--card-bg); width: 90%; max-width: 350px; border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 15px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); border: 2px solid var(--purple-berry); }
.sc-preview { width: 100%; height: 300px; object-fit: contain; background: #000; border-radius: 10px; }
.sc-controls { display: flex; flex-direction: column; gap: 10px; }
.sc-btn { padding: 12px; border-radius: 10px; border: none; font-weight: bold; cursor: pointer; font-size: 14px; }
.sc-btn-send { background: linear-gradient(45deg, var(--green-leaf), var(--purple-berry)) !important; color: white; }
.sc-btn-cancel { background: #f0f2f5; color: #333; }

/* MODAL DE TÓPICOS */
#topics-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 6100; display: none; align-items: center; justify-content: center; }
.topics-content { background: var(--card-bg); width: 90%; max-width: 350px; border-radius: 20px; padding: 25px; display: flex; flex-direction: column; gap: 15px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); border: 1px solid var(--border-color); animation: slideUp 0.2s; }
.topics-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.topics-grid button { padding: 8px 15px; border-radius: 20px; border: 1px solid var(--border-color); background: #f9f9f9; color: var(--text-main); font-size: 13px; font-weight: 600; cursor: pointer; }
.topics-grid button:hover { background: var(--green-light); color: var(--green-leaf); border-color: var(--green-leaf); }

/* 🔥 FEED POSTS - AGORA COM MARGEM INFERIOR DE 8PX APENAS 🔥 */
.feed-post { background: var(--card-bg); border-radius: 15px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); overflow: hidden; animation: fadeIn 0.5s ease; width: 100%; transition: background 0.3s; }
.post-header { padding: 15px; display: flex; align-items: center; justify-content: space-between; }
.user-info { display: flex; align-items: center; gap: 10px; max-width: 65%; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-meta { flex: 1; min-width: 0; }
.user-meta h4 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; color: var(--text-main); }
.user-meta span { font-size: 12px; color: var(--text-sec); display: flex; align-items: center; gap: 4px; }
.post-header-right { display: flex; align-items: center; gap: 8px; }
.location-badge { background: var(--green-leaf); color: white; padding: 6px 12px; border-radius: 20px; font-size: 11px; font-weight: bold; cursor: pointer; display: flex; align-items: center; gap: 4px; white-space: nowrap; transition: transform 0.2s, box-shadow 0.2s; border: none; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.location-badge:active { transform: scale(0.95); }

.delete-post-btn { background: none; border: none; color: #ff5252; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; padding: 4px; border-radius: 50%; }
.delete-post-btn:hover { background: #ffebee; }
.edit-post-btn { background: none; border: none; color: var(--text-sec); cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; padding: 4px; border-radius: 50%; }
.edit-post-btn:hover { background: var(--bg-body); color: var(--purple-berry); }

.btn-mini-action { background: var(--bg-body); border: 1px solid var(--border-color); color: var(--text-sec); border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; margin-left: 5px; flex-shrink: 0; }
.btn-mini-action.btn-msg-chat:hover { background: var(--green-light) !important; color: var(--green-leaf) !important; border-color: var(--green-leaf); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.btn-mini-action.btn-add-friend:hover { background: var(--purple-light) !important; color: var(--purple-berry) !important; border-color: var(--purple-berry); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.btn-mini-action:active { transform: scale(0.9); }

.post-image { width: 100%; max-height: 500px; object-fit: cover; background: #eee; cursor: pointer; display: block; transition: opacity 0.2s; }
.post-image:hover { opacity: 0.95; }
.post-stats { padding: 10px 15px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; font-size: 11px; color: var(--text-sec); cursor: pointer;}
.post-actions { display: flex; padding: 5px; }
.action-btn { flex: 1; border: none; background: none; padding: 10px 5px; border-radius: 8px; font-weight: 600; color: var(--text-sec); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; transition: 0.2s; font-size: 12px; }
.action-btn:hover { background: var(--bg-body); }
.action-btn.liked { color: #e91e63 !important; animation: pulse 0.3s; }
.action-btn.liked .material-icons-round { color: #e91e63 !important; }

.likers-row { display: flex; align-items: center; padding: 0 15px 10px; margin-top: -5px; overflow-x: auto; scrollbar-width: none; }
.likers-row::-webkit-scrollbar { display: none; }
.like-mini-avatar { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--card-bg); margin-right: -8px; cursor: pointer; transition: transform 0.2s; object-fit: cover; }
.like-mini-avatar:hover { z-index: 10; transform: scale(1.2); }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 7000; align-items: center; justify-content: center; }
.modal-content { background: var(--card-bg, #ffffff); width: 90%; max-width: 350px; border-radius: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); overflow: hidden; animation: slideUp 0.2s; }
.modal-header { padding: 15px 20px; border-bottom: 1px solid var(--border-color, #eee); display: flex; justify-content: space-between; align-items: center; background: var(--card-bg, #f9f9f9); }
.modal-header h3 { margin: 0; font-size: 16px; color: var(--text-main, #333); }
.modal-body { max-height: 300px; overflow-y: auto; background: var(--card-bg, #ffffff); padding-bottom: 10px; }
.dark-mode .modal-header { background: #1c1c1d; }

.post-text { padding: 0 15px; font-size: 14px; line-height: 1.5; color: var(--text-main); white-space: pre-wrap; word-break: break-word; margin-bottom: 4px; }
.post-text.collapsed { display: -webkit-box; -webkit-line-clamp: 5; line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; padding-bottom: 2px; }
.btn-read-more { background: none; border: none; color: var(--purple-berry); font-weight: 600; font-size: 13px; cursor: pointer; padding: 2px 15px 5px 15px; margin-top: 0; margin-bottom: 0; display: block; }
.btn-read-more:hover { text-decoration: underline; color: var(--green-leaf); }

.comments-section { background: transparent; padding: 10px 15px; display: none; border-top: 1px solid var(--border-color); }
.dark-mode .comments-section { background: transparent; }
.comment-item { display: flex; gap: 8px; font-size: 13px; margin-bottom: 12px; animation: fadeIn 0.3s ease; }
.comment-bubble { background: #f0f2f5; padding: 8px 12px; border-radius: 18px; color: var(--text-main); display: inline-block; max-width: 100%; word-wrap: break-word; }
.dark-mode .comment-bubble { background: #3a3b3c; color: #e4e6eb; }
.comment-author { font-weight: 700; color: var(--text-main); display: block; margin-bottom: 2px; font-size: 12px; }
.comment-text { font-size:13px; white-space: pre-wrap; line-height: 1.3; }
.comment-text.collapsed { display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.btn-read-more-comment { background: none; border: none; color: var(--purple-berry); font-size: 11px; font-weight: bold; cursor: pointer; padding: 2px 0; margin-left: 0; display: block; }
.comment-actions { display: flex; gap: 10px; margin-left: 12px; margin-top: 2px; font-size: 11px; color: var(--text-sec); font-weight: bold; align-items: center; }
.comment-act-btn { cursor: pointer; background: none; border: none; color: inherit; font-size: inherit; font-weight: inherit; padding: 0; }
.comment-act-btn:hover { text-decoration: underline; }
.comment-act-btn.liked { color: #e91e63; }

.replies-list { width: 100%; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.reply-item { display: flex; gap: 8px; font-size: 12px; animation: fadeIn 0.3s ease; }
.reply-input-wrapper { display: none; align-items: center; gap: 8px; margin-top: 8px; width: 100%; }
.main-comment-input-area { display:flex; gap:8px; align-items:center; margin-top:10px; border-top: 1px solid var(--border-color); padding-top: 10px; }
.reply-input-field { flex: 1; background: #f0f2f5; border: none; border-radius: 20px; padding: 10px 15px; font-size: 13px; outline: none; color: var(--text-main); }
.dark-mode .reply-input-field { background: #3a3b3c; color: white; }

#crop-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 5000; display: none; flex-direction: column; align-items: center; justify-content: center; }
.crop-container { width: 100%; height: 70vh; background: #333; overflow: hidden; }
#image-to-crop { max-width: 100%; display: block; }
.crop-controls { display: flex; gap: 15px; width: 100%; padding: 20px; background: #000; justify-content: center; }
.btn-crop-ctrl { background: #333; color: white; border: none; border-radius: 50%; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.btn-crop-save { background: var(--green-leaf); color: white; border: none; padding: 0 30px; border-radius: 25px; font-weight: bold; cursor: pointer; }

.mobile-nav { position: fixed; bottom: 0; left: 0; width: 100%; height: 65px; background: white; border-top: 1px solid #ddd; display: flex; justify-content: space-around; align-items: center; z-index: 1000; padding-bottom: 5px; }
@media (min-width: 900px) { .mobile-nav { display: none; } }
.nav-item { display: flex; flex-direction: column; align-items: center; font-size: 10px; color: #999; text-decoration: none; transition: all 0.3s ease; flex: 1; position: relative; cursor: pointer; }
.nav-item.active { color: var(--green-leaf); font-weight: bold; }
.nav-item span { font-size: 24px; margin-bottom: 2px; }

.ai-chat-overlay { position: fixed; bottom: 20px; right: 20px; width: 350px; height: 450px; background: white; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 5000; display: none; flex-direction: column; overflow: hidden; border: 1px solid #e0e0e0; animation: slideUp 0.3s ease; }
.dark-mode .ai-chat-overlay { background: #242526; border-color: #3e4042; }
@media (max-width: 899px) { .ai-chat-overlay { width: 90%; right: 5%; left: 5%; bottom: 75px; max-width: 400px; margin: 0 auto; } }
.ai-chat-header { background: linear-gradient(135deg, var(--green-leaf), var(--purple-berry)); color: white; padding: 15px; display: flex; align-items: center; justify-content: space-between; font-weight: bold; }
.ai-chat-body { flex: 1; padding: 15px; overflow-y: auto; background: #f9f9f9; display: flex; flex-direction: column; gap: 10px; }
.dark-mode .ai-chat-body { background: #18191a; }
.ai-msg { padding: 10px; border-radius: 10px; font-size: 13px; max-width: 80%; word-wrap: break-word; overflow-wrap: anywhere; }
.ai-msg.bot { background: white; border: 1px solid #eee; align-self: flex-start; border-bottom-left-radius: 2px; }
.dark-mode .ai-msg.bot { background: #3a3b3c; border-color: #3e4042; color: #e4e6eb; }
.ai-msg.user { background: #e8f5e9; color: var(--green-leaf); align-self: flex-end; border-bottom-right-radius: 2px; }
.dark-mode .ai-msg.user { background: #2e3b30; color: #81c784; }
.ai-input-area { padding: 10px; border-top: 1px solid #eee; display: flex; gap: 5px; background: white; }
.dark-mode .ai-input-area { background: #242526; border-color: #3e4042; }
.ai-input { flex: 1; border: 1px solid #ddd; border-radius: 20px; padding: 8px 12px; outline: none; -webkit-appearance: none; appearance: none; }
.dark-mode .ai-input { background: #3a3b3c; border-color: #555; color: white; }

.chat-dock { position: fixed; bottom: 0; right: 20px; z-index: 6000; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 15px; pointer-events: none; }
.mini-chat-window { width: 300px; height: 400px; background: var(--card-bg); border-radius: 15px 15px 0 0; box-shadow: 0 -5px 20px rgba(0,0,0,0.15); display: flex; flex-direction: column; pointer-events: auto; border: 1px solid var(--border-color); transition: transform 0.3s ease; background: white; animation: slideUp 0.3s ease; }
.dark-mode .mini-chat-window { background: #242526; border-color: #3e4042; }
.chat-win-header { padding: 10px 15px; background: linear-gradient(45deg, var(--green-leaf), var(--purple-berry)); color: white; border-radius: 12px 12px 0 0; display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: bold; cursor: pointer; }
.chat-win-header:hover { filter: brightness(1.1); }
.chat-win-controls { display: flex; gap: 10px; }
.chat-win-body { flex: 1; overflow-y: auto; padding: 10px; background: #f9f9f9; display: flex; flex-direction: column; gap: 8px; }
.dark-mode .chat-win-body { background: #18191a; }
.chat-win-input-area { padding: 10px; border-top: 1px solid var(--border-color); display: flex; gap: 5px; background: var(--card-bg); }

.typing-indicator { display: none; background: #e0e0e0; border-radius: 12px; padding: 8px 12px; align-self: flex-start; border-bottom-left-radius: 2px; width: fit-content; margin-bottom: 5px; }
.dark-mode .typing-indicator { background: #3a3b3c; }
.typing-dots { display: flex; align-items: center; gap: 3px; }
.dot { width: 6px; height: 6px; background: #888; border-radius: 50%; animation: typingBounce 1.4s infinite ease-in-out both; }
.dot:nth-child(1) { animation-delay: -0.32s; } .dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

@media (max-width: 768px) {
    .chat-dock { right: 0; left: 0; bottom: 65px; justify-content: center; flex-direction: row; }
    .mini-chat-window { width: 95%; max-width: 350px; height: 60vh; box-shadow: 0 0 50px rgba(0,0,0,0.5); }
    .mini-chat-window:nth-child(n+2) { display: none; }
}

/* 🔥 AD-CARD COM MARGEM DE 8PX 🔥 */
.ad-card { background: var(--card-bg); border-radius: 15px; padding: 15px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); text-align: center; border: 1px dashed var(--border-color); width: 100%; }
.ad-content { background: var(--bg-body); padding: 20px; border-radius: 10px; color: #999; font-size: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 150px; }
.ad-badge { background: #eee; color: #666; padding: 2px 6px; border-radius: 4px; font-size: 9px; margin-bottom: 5px; display: inline-block; }

.feed-lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 4000; display: none; align-items: center; justify-content: center; animation: fadeIn 0.2s; overflow: hidden; }
.lightbox-zoom-wrapper { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.lightbox-img { max-width: 85vw; max-height: 80vh; object-fit: contain; border-radius: 5px; width: auto; height: auto; box-shadow: 0 0 20px rgba(0,0,0,0.5); } 
.lightbox-close { position: absolute; top: 20px; right: 20px; color: white; font-size: 30px; cursor: pointer; background: rgba(255,255,255,0.1); border-radius: 50%; padding: 5px; z-index: 4002; }
.lightbox-controls { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; gap: 20px; z-index: 4002; }
.btn-zoom-ctrl { background: rgba(255,255,255,0.1); color: white; border: 1px solid rgba(255,255,255,0.3); border-radius: 50%; width: 50px; height: 50px; font-size: 24px; cursor: pointer; backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; }
.btn-zoom-ctrl:hover { background: rgba(255,255,255,0.3); }

.toast-notification { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #333; color: white; padding: 10px 20px; border-radius: 30px; font-size: 14px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); z-index: 5000; display: none; align-items: center; gap: 8px; }

@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { transform: translateY(0); opacity: 1; } }

.sidebar { display: none; }
@media (min-width: 900px) { .sidebar { display: block; } }
.card-side { background: var(--card-bg); border-radius: 15px; padding: 15px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); transition: background 0.3s; }
.side-title { font-size: 14px; font-weight: 700; color: var(--text-sec); margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.5px; }
.friend-item { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; cursor: pointer; color: var(--text-main); }
.card-side:hover { transform: translateY(-2px); }

.ranking-list { max-height: 250px; overflow-y: auto; padding-right: 5px; }
.ranking-list::-webkit-scrollbar { width: 4px; }
.ranking-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.ranking-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-color); color: var(--text-main); }
.rank-badge { width: 25px; height: 25px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 12px; color: white; flex-shrink: 0; }
.rank-1 { background: var(--gold); box-shadow: 0 0 10px var(--gold); } .rank-2 { background: var(--silver); } .rank-3 { background: var(--bronze); } .rank-4 { background: #E91E63; } .rank-5 { background: #9C27B0; } .rank-7 { background: #2196F3; }
.rank-score { margin-left: auto; font-size: 12px; font-weight: bold; color: var(--green-leaf); }

.suggestion-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.suggestion-card { background: var(--card-bg); border-radius: 8px; padding: 5px; text-align: center; border: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; transition: transform 0.2s; min-height: auto; box-shadow: 0 1px 3px rgba(0,0,0,0.05); cursor: pointer; }
.suggestion-card:hover { transform: translateY(-2px); }
.suggestion-img { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; margin-bottom: 2px; border: 1px solid var(--bg-body); }
.suggestion-name { font-size: 11px; font-weight: bold; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; color: var(--text-main); }
.btn-add-friend-sug { background: var(--purple-light); color: var(--green-leaf); border: none; padding: 4px 8px; border-radius: 6px; font-size: 10px; font-weight: bold; cursor: pointer; margin-top: 2px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 2px; }
.btn-add-friend-sug:hover { background: #e1bee7; }

body.left-handed-mode .main-layout { direction: rtl; }
body.left-handed-mode .main-layout > * { direction: ltr; }
body.left-handed-mode .post-header { flex-direction: row-reverse; }
body.left-handed-mode .user-info { flex-direction: row-reverse; text-align: right; }
body.left-handed-mode .post-actions { flex-direction: row-reverse; }
body.left-handed-mode .cp-btn { flex-direction: row-reverse; }
body.left-handed-mode .chat-dock { right: auto !important; left: 20px !important; flex-direction: row !important; }
body.left-handed-mode .ai-chat-overlay { right: auto !important; left: 20px !important; }
body.left-handed-mode .mobile-nav { flex-direction: row-reverse; }

.leaflet-popup-content-wrapper { padding: 0 !important; border-radius: 8px; }
.leaflet-popup-content { margin: 0 !important; width: 250px !important; }
.cabecalho-via { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; background-color: #f8f9fa; border-bottom: 1px solid #ddd; margin: 0; }
.cabecalho-via h3 { margin: 0 !important; font-size: 16px; color: #333; }
.fechar-via { cursor: pointer; font-size: 20px; font-weight: bold; color: #999; line-height: 1; }