:root {
    --bg-color: #000000;
    --text-color: #F5F5F7;
    --text-secondary: #86868B;
    --accent-color: #FFD600;
    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --message-out-bg: #005C4B;
    --message-in-bg: #202C33;
    --danger-color: #FF453A;
    --group-bg: #1c1c1e;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="light"] {
    --bg-color: #FFFFFF;
    --text-color: #000000;
    --text-secondary: #666666;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.12);
    --message-out-bg: #DCF8C6;
    --message-in-bg: #E8E8E8;
    --group-bg: #FFFFFF;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--font-family);
    scrollbar-width: none;
}

*::-webkit-scrollbar {
    display: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    transition: background-color 0.3s, color 0.3s;
}

#app {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    position: relative;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.glass-header {
    position: fixed;
    top: 0;
    width: 100%;
    max-width: 600px;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 0 16px;
    transition: height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    border: 1px solid rgba(128, 128, 128, 0.25);
    border-top: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    height: 56px;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    left: 50%;
    transform: translateX(-50%);
}

#header-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.glass-header.hidden {
    display: none;
}

.glass-header.home-view-header {
    height: 56px;
    justify-content: center;
}

.glass-header.home-view-header.expanded {
    height: 135px;
    background: var(--glass-bg);
    border-bottom: 1px solid rgba(128, 128, 128, 0.25);
    justify-content: flex-start;
    padding-top: 8px;
}

.header-home-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 40px;
    flex-shrink: 0;
    padding: 0 4px;
}

.logo-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.logo-btn img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.header-right-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.char-counter {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.char-counter.visible {
    opacity: 1;
}

.char-counter.warning {
    color: var(--accent-color);
}

.char-counter.danger {
    color: var(--danger-color);
}

.create-btn-header {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: opacity 0.3s ease;
}

.create-btn-header.faded {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.mood-section {
    opacity: 0;
    max-height: 0;
    pointer-events: none;
    transition: opacity 0.3s, max-height 0.3s;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    margin-top: 2px;
}

.glass-header.expanded .mood-section {
    opacity: 1;
    max-height: 80px;
    pointer-events: auto;
}

.header-search-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
    outline: none;
    padding: 0;
    height: 40px;
    margin: auto 0;
}

.header-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.chat-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.chat-back-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.chat-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-header-name {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-actions-pill {
    display: flex;
    align-items: center;
    gap: 35px;
    padding: 2px 6px;
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    margin-left: 10px;
}

.chat-action-icon {
    color: var(--accent-color);
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
}

.profile-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 50px;
}

.profile-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-header-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-header-info-wrap {
    display: flex;
    flex-direction: column;
}

.profile-header-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.profile-header-info {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.profile-header-name-main {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.bond-status-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.4s ease;
    min-width: 85px;
}

.bond-status-btn.requested {
    background: transparent;
    border-color: var(--text-secondary);
    color: var(--text-secondary);
    min-width: 85px;
}

.bond-status-btn.bonded {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #000;
    min-width: 85px;
}

.profile-settings-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 22px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.mood-input {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 16px;
    width: 100%;
    outline: none;
    padding: 0;
    margin: 0 2px;
    height: 28px;
    line-height: 28px;
}

.mood-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.mood-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
    width: 100%;
    margin-top: 15px;
}

.mood-left-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mood-upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mood-upload-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
    width: 30px;
}

.mood-upload-text {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.mood-limit-warn {
    font-size: 9px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 2px;
    opacity: 0;
}

.mood-limit-warn.visible {
    opacity: 1;
}

.mood-images-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 45px;
    position: relative;
    min-width: 120px;
}

.mood-images-container {
    display: inline-flex;
    align-items: center;
    position: relative;
    min-width: 120px;
    margin-left: 8px;
}

.mood-img-preview {
    height: 40px;
    width: auto;
    max-width: 50px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    position: absolute;
    transition: transform 0.2s ease;
}

.mood-img-preview:nth-child(1) {
    transform: rotate(-8deg);
    left: 0;
    z-index: 1;
}

.mood-img-preview:nth-child(2) {
    transform: rotate(0deg);
    left: 25px;
    z-index: 2;
}

.mood-img-preview:nth-child(3) {
    transform: rotate(8deg);
    left: 50px;
    z-index: 1;
}

.mood-done-btn {
    background: var(--text-color);
    color: var(--bg-color);
    font-weight: 600;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
}

#main-content {
    flex: 1;
    overflow-y: auto;
    padding-top: 60px;
    padding-bottom: 90px;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

#main-content.pushed {
    transform: translateY(80px);
}

#main-content.chat-view {
    padding-bottom: 70px;
}

.glass-tabbar {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 600px;
    min-height: 55px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    border: 1px solid rgba(128, 128, 128, 0.25);
    border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

#footer-tabs {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
}

#footer-tabs.hidden {
    display: none;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.3s;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}

.tab-btn.active {
    color: var(--text-color);
}

.tab-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger-color);
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.footer-chat-input {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    gap: 10px;
}

.footer-chat-input.hidden {
    display: none;
}

.chat-attach-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    color: #000;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, background 0.2s;
}

.chat-attach-btn:active {
    transform: scale(0.95);
}

.chat-attach-btn.rotated {
    transform: rotate(45deg);
    background: var(--text-secondary);
}

.chat-msg-input {
    flex: 1;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    color: var(--text-color);
    font-size: 18px;
    outline: none;
    min-width: 0;
}

.chat-msg-input::placeholder {
    color: var(--text-secondary);
}

[data-theme="light"] .chat-msg-input {
    background: rgba(0, 0, 0, 0.05);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    color: #000;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, opacity 0.2s;
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-attach-menu {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    padding: 0 16px;
    z-index: 99;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.chat-attach-menu.visible {
    pointer-events: auto;
    opacity: 1;
}

.chat-attach-menu-content {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.chat-attach-menu.visible .chat-attach-menu-content {
    transform: translateY(0);
}

.attach-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.attach-option:active {
    transform: scale(0.95);
}

.attach-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.attach-option span {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.inline-img-group {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin: 4px 6px;
}

.inline-img {
    height: 66px;
    width: auto;
    border-radius: 10px;
    cursor: pointer;
    object-fit: contain;
}

.inline-img:only-child {
    transform: rotate(0deg) !important;
    margin: 0;
}

.inline-img:not(:only-child) {
    margin: 0 -8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: rotate(-8deg) !important;
}

[data-theme="dark"] .inline-img:not(:only-child) {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
}

.inline-img:nth-child(2) {
    transform: rotate(0deg) !important;
    z-index: 2;
}

.inline-img:nth-child(3) {
    transform: rotate(8deg) !important;
    z-index: 1;
}

.post-card {
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    animation: fadeIn 0.5s ease;
}

.post-header {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.post-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: #333;
}

.post-info {
    flex: 1;
}

.post-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-color);
}

.post-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.post-content-wrapper {
    cursor: pointer;
    transition: opacity 0.2s;
}

.post-content-wrapper:active {
    opacity: 0.8;
}

.post-content {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-color);
    margin-bottom: 8px;
    max-height: 500px;
    overflow: hidden;
    position: relative;
}

.post-content.truncated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, transparent, var(--bg-color));
    pointer-events: none;
}

.see-more-text {
    font-size: 14px;
    color: var(--accent-color);
    margin-bottom: 12px;
    display: none;
    font-weight: 500;
}

.post-actions {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.post-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.post-action-count {
    font-size: 13px;
    color: var(--text-secondary);
}

.msg-container {
    padding-bottom: 80px;
}

.chat-row {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-content {
    flex: 1;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
}

.chat-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.chat-name {
    font-weight: 600;
    font-size: 16px;
}

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

.chat-msg {
    font-size: 14px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 250px;
}

.chat-detail-container {
    height: calc(100vh - 60px - 70px);
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 18px;
    margin-bottom: 4px;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

.message.incoming {
    background-color: var(--message-in-bg);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.outgoing {
    background-color: var(--message-out-bg);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

[data-theme="light"] .message.outgoing {
    color: #000;
}

.message-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    text-align: right;
}

[data-theme="light"] .message-time {
    color: rgba(0, 0, 0, 0.5);
}

.message-image {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 4px;
    cursor: pointer;
}

.message-poll {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    min-width: 200px;
}

.message-poll-question {
    font-weight: 600;
    margin-bottom: 10px;
}

.message-poll-option {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.message-poll-option:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-input-area {
    display: none;
}

#create-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 200;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

#create-page.hidden {
    display: none;
}

.editor-header {
    height: 48px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.editor-header-left,
.editor-header-right {
    width: 50px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--glass-border);
}

.editor-header-right {
    border-right: none;
    border-left: 1px solid var(--glass-border);
}

.editor-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-publish-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #ef233c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.editor-publish-btn:hover {
    transform: scale(1.1);
}

.editor-tools {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tool-divider {
    width: 1px;
    height: 32px;
    /* Increased from 24px */
    background: var(--glass-border);
    margin: 0 8px;
    /* Added a bit more breathing room */
}

.tool-btn {
    width: 44px;
    /* Increased from 32px */
    height: 44px;
    /* Increased from 32px */
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 24px;
    /* Increased from 18px */
    cursor: pointer;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: var(--glass-border);
    color: var(--text-color);
}

.tool-btn.active {
    background: var(--accent-color);
    color: #000;
}

.editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
}

.editor-title-row {
    display: flex;
    flex-direction: column;
    /* Stacks them vertically */
    align-items: flex-end;
    /* Pushes content (counter) to the right */
    gap: 5px;
    /* Reduces gap between counter and input */
    margin-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
}

.title-counter {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.editor-title-input {
    width: 100%;
    /* Ensures input takes full width */
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    font-size: 20px;
    font-weight: 600;
}

.editor-title-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.editor-content-wrapper {
    flex: 1;
    position: relative;
    min-height: 200px;
}

.editor-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--text-secondary);
    opacity: 0.5;
    font-size: 16px;
    pointer-events: none;
}

.editor-placeholder.hidden {
    display: none;
}

.editor-content {
    width: 100%;
    min-height: 100%;
    outline: none;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
}

.editor-char-counter {
    text-align: right;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-top: 1px solid var(--glass-border);
}

.poll-container {
    background: var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
}

.poll-question-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--text-secondary);
    padding: 8px 0;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
    outline: none;
    margin-bottom: 12px;
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.poll-option-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.poll-option-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-color);
    font-size: 14px;
    outline: none;
}

.poll-option-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.poll-add-btn {
    margin-top: 8px;
    padding: 10px;
    background: var(--glass-border);
    border: none;
    border-radius: 8px;
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.poll-add-btn:hover {
    background: var(--text-secondary);
}

.inline-media {
    display: inline-block;
    height: 66px;
    border-radius: 10px;
    margin: 4px 6px;
    cursor: pointer;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .inline-media {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
}

.gif-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.gif-modal.active {
    display: flex;
    opacity: 1;
}

.gif-modal-panel {
    width: 100%;
    height: 85vh;
    background: var(--bg-color);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gif-modal.active .gif-modal-panel {
    transform: translateY(0);
}

.gif-search-row {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.gif-search-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--glass-border);
    border-radius: 12px;
    padding: 0 12px;
    height: 40px;
}

.gif-search-icon {
    color: var(--text-secondary);
    font-size: 18px;
    margin-right: 8px;
}

#gif-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 16px;
}

#gif-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
}

.gif-tabs {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
}

.gif-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    padding: 12px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.gif-tab.active {
    color: var(--text-color);
    border-bottom-color: #ef233c;
}

.gif-results {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    overflow-y: auto;
    padding: 4px;
}

.gif-item {
    width: 33.333%;
    aspect-ratio: 1;
    padding: 2px;
    box-sizing: border-box;
    cursor: pointer;
}

@media (min-width: 600px) {
    .gif-item {
        width: 20%;
    }
}

.gif-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    background: var(--glass-border);
}

.gif-loader {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.gif-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: gif-spin 0.8s linear infinite;
}

@keyframes gif-spin {
    to {
        transform: rotate(360deg);
    }
}

.lightbox-content {
    display: flex;
    width: 100%;
    height: 80%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
    scrollbar-width: none;
    position: relative;
}

.lightbox-img-wrapper {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    scroll-snap-align: center;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.lightbox-content {
    cursor: grab;
}

.lightbox-content:active {
    cursor: grabbing;
}

.lightbox-dots {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5002;
}

.lightbox-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: background 0.2s, transform 0.2s;
}

.lightbox-dot.active {
    background: #fff;
    transform: scale(1.3);
}

.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.popup-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.popup-content {
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
    padding: 24px;
    border-radius: 18px;
    width: 280px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-overlay.visible .popup-content {
    transform: scale(1);
}

.popup-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.popup-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.popup-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.popup-btn {
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

#settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 300;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

#settings-modal.active {
    transform: translateX(0);
}

.settings-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    /* Matches home header height */
    z-index: 10;

    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);

    border: 1px solid rgba(128, 128, 128, 0.25);
    border-top: none;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;

    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 15px;
}

.settings-list {
    padding: 76px 16px 20px 16px;
    /* Increased top padding (56px header + 20px gap) */
    overflow-y: auto;
    background: transparent;
    height: 100%;
    /* Ensures it scrolls properly within the modal */
}

.settings-group-header {
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
    margin-top: 10px;
    letter-spacing: 0.5px;
}

/* First header shouldn't have top margin */
.settings-group-header:first-child {
    margin-top: 0;
}

.settings-group {
    background-color: var(--group-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: transparent;
    /* No bg for items, they use the group's bg */
    border-bottom: 1px solid var(--glass-border);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.settings-item:hover {
    background: rgba(128, 128, 128, 0.05);
}

/* Remove border from the last item in a group */
.settings-item:last-child {
    border-bottom: none;
}

.settings-icon {
    margin-right: 15px;
    font-size: 20px;
    color: var(--text-secondary);
}

.settings-item-left {
    display: flex;
    align-items: center;
}

.settings-logout-btn {
    justify-content: center;
    color: var(--danger-color);
    font-weight: 600;
}

.theme-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    transition: all 0.3s;
    position: relative;
    flex-shrink: 0;
}

.theme-indicator::before {
    content: '';
    position: absolute;
    width: 40%;
    height: 40%;
    border-radius: 50%;
    top: 12%;
    left: 15%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
}

.theme-indicator::after {
    content: '';
    position: absolute;
    width: 20%;
    height: 10%;
    border-radius: 50%;
    bottom: 18%;
    right: 20%;
    background: rgba(255, 255, 255, 0.2);
    filter: blur(1px);
}

.theme-indicator.show-light {
    background: radial-gradient(circle at 65% 65%, #a0a0a0 0%, #d0d0d0 40%, #ffffff 100%);
    box-shadow:
        4px 4px 10px rgba(0, 0, 0, 0.4),
        inset -3px -3px 8px rgba(0, 0, 0, 0.15);
}

.theme-indicator.show-dark {
    background: radial-gradient(circle at 65% 65%, #000000 0%, #1a1a1a 40%, #3a3a3a 100%);
    box-shadow:
        4px 4px 10px rgba(0, 0, 0, 0.6),
        inset -3px -3px 8px rgba(0, 0, 0, 0.5);
}

#settings-sub-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    z-index: 301;
}

#settings-sub-page.active {
    transform: translateX(0);
}

#settings-page-content {
    padding: 76px 16px 20px 16px;
    overflow-y: auto;
    height: 100%;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
    padding: 40px;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.empty-state p {
    font-size: 14px;
}

.auth-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.auth-input {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 16px;
}

.auth-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #F5C518, #FFD700);
    color: black;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    margin-top: 20px;
    cursor: pointer;
}

.switch-auth {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.switch-auth a {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}

.chat-poll-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.chat-poll-modal.active {
    display: flex;
    opacity: 1;
}

.chat-poll-panel {
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    padding: 20px;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.chat-poll-modal.active .chat-poll-panel {
    transform: scale(1);
}

.chat-poll-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chat-poll-title {
    font-weight: 700;
    font-size: 18px;
}

.chat-poll-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

.chat-poll-question {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-color);
    font-size: 16px;
    outline: none;
    margin-bottom: 16px;
}

.chat-poll-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.chat-poll-option-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-color);
    font-size: 14px;
    outline: none;
}

.chat-poll-add-option {
    background: transparent;
    border: 1px dashed var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-poll-add-option:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.chat-poll-send {
    width: 100%;
    background: var(--accent-color);
    border: none;
    border-radius: 12px;
    padding: 14px;
    color: #000;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-poll-send:active {
    transform: scale(0.98);
}

#post-detail-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 200;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

#post-detail-page.hidden {
    display: none;
}

.post-detail-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
}

.post-detail-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

[data-theme="light"] .post-detail-close-btn {
    background: rgba(0, 0, 0, 0.08);
}

.post-detail-actions {
    display: flex;
    gap: 15px;
}

/* Ensure icons inside detail actions are normal size */
#post-detail-actions .post-action-btn {
    font-size: 18px;
    /* Match standard post action button size */
}

.post-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 80px 20px;
    margin-top: 60px;
}

.post-detail-content {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-color);
}

.post-detail-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.post-detail-user-header .post-info {
    flex: 1;
}

.post-detail-user-header .post-options-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.post-options-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 3500;
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.post-options-modal.active {
    display: flex;
    opacity: 1;
}

.post-options-panel {
    width: 100%;
    max-width: 600px;
    background: var(--bg-color);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    padding: 12px 16px 30px 16px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.post-options-modal.active .post-options-panel {
    transform: translateY(0);
}

.post-options-handle {
    width: 40px;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 2px;
    margin: 0 auto 16px auto;
    opacity: 0.5;
}

.post-options-group {
    background: rgba(128, 128, 128, 0.12);
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
}

[data-theme="light"] .post-options-group {
    background: rgba(0, 0, 0, 0.05);
}

.post-options-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    font-size: 17px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    border-bottom: 1px solid rgba(128, 128, 128, 0.15);
    transition: background 0.2s;
}

.post-options-item:last-child {
    border-bottom: none;
}

.post-options-item:active {
    background: rgba(128, 128, 128, 0.1);
}

.post-options-item i {
    font-size: 22px;
    color: var(--text-color);
}

.post-options-item.danger {
    color: #ef233c;
}

.post-options-item.danger i {
    color: #ef233c;
}

.comment-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2500;
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.comment-modal.active {
    display: flex;
    opacity: 1;
}

.comment-modal-panel {
    width: 100%;
    max-width: 600px;
    height: 70vh;
    background: var(--bg-color);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.comment-modal.active .comment-modal-panel {
    transform: translateY(0);
}

.comment-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--glass-border);
}

.comment-modal-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.comment-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.comment-modal-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    min-height: 55px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(128, 128, 128, 0.25);
    border-bottom: none;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

.comment-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 0;
    font-size: 19px;
    color: var(--text-color);
    outline: none;
}

.comment-input::placeholder {
    color: var(--text-secondary);
}

.comment-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.comment-action-btn.send-mode {
    color: var(--accent-color);
}

[data-theme="light"] .comment-action-btn {
    -webkit-text-stroke: 1px #000;
}

[data-theme="light"] .comment-action-btn.send-mode {
    -webkit-text-stroke: 1px #000;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--glass-border);
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
}

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

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

.comment-text img {
    max-height: 180px;
    border-radius: 8px;
    margin-top: 8px;
}

.no-comments {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
}

.no-comments i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.no-comments p {
    font-size: 14px;
}