:root {
    --bg-color: #000000;
    --card-bg: rgba(20, 20, 20, 0.8);
    --accent-color: #38bdf8;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --star-active: #fbbf24;
    --glass-border: rgba(255, 255, 255, 0.1);
    --nav-height: 70px;
    --header-height: 100px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    height: 100vh;
    width: 100vw;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

#main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    min-height: 60px;
    padding-top: 100px;
    /* Telegram butonları altına indirildi */
    background: #000000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 15px;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Compact icons */
}

#page-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.icon-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    padding: 8px;
    border-radius: 50%;
}

.badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #000;
}

.badge.hidden {
    display: none;
}


.icon-btn:hover {
    color: var(--accent-color);
    background: rgba(56, 189, 248, 0.1);
}


.nav-avatar {
    width: 38px;
    /* Biraz büyütüldü */
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    position: absolute;
    right: 0;
    top: 48px;
    /* Avatar büyüdüğü için ayarlandı */
    background-color: #000000;
    min-width: 140px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

.dropdown-content button {
    color: var(--text-primary);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.dropdown-content button:hover {
    background-color: var(--glass-border);
}

.lang-inline {
    display: flex;
    border-top: 1px solid var(--glass-border);
}

.lang-inline button {
    text-align: center;
    font-size: 12px;
}

.dropdown-content.hidden {
    display: none;
}

#content {
    flex: 1;
    margin-top: 0;
    margin-bottom: 0;
    /* Removed fixed nav margin */
    padding: 0;
    overflow-y: auto;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

#content::-webkit-scrollbar {
    display: none;
}

/* Views */
#dynamic-view-container {
    display: contents;
    /* Ensures dynamic child acts directly in flex layout */
}

.view {
    display: none;
    padding-top: 180px;
    padding-bottom: 24px;
    /* Added spacing from bottom of the screen if no nav */
    padding-left: 20px;
    padding-right: 20px;
    flex: 1;
    animation: fadeIn 0.4s ease;
}

.view.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Share Section */
.share-container {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    /* Pushed down */
}

.input-wrapper {
    position: relative;
}

#post-input {
    width: 100%;
    height: 60px;
    /* Thinner */
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    resize: none;
    font-family: inherit;
    outline: none;
    padding-bottom: 30px;
    /* Space for footer */
}

.input-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
}

.char-count {
    font-size: 11px;
    color: var(--text-secondary);
}

.btn-sm {
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}

#share-btn.hidden {
    display: none;
}

#share-btn:active {
    transform: scale(0.98);
}

/* Post list */
#posts-list,
.posts-list-profile {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-item {
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    display: flex;
    gap: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: 0.3s;
}

.post-item:active {
    transform: scale(0.99);
}

.post-avatar-container {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.post-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.follow-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #000000;
    border: 1.5px solid var(--accent-color);
    border-radius: 50%;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 2;
    transition: 0.2s;
}

.follow-badge:active {
    transform: scale(1.2);
}

.post-content-wrapper {
    flex: 1;
}

.post-user-info {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.verified-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.verified-icon-lg {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-left: 1px;
    /* Sol tarafa çekildi */
    margin-top: -4px;
    /* Yukarı kaldırıldı */
    display: inline-block;
}

.clickable {
    cursor: pointer;
}

.post-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 12px;
    word-break: break-word;
}

.post-actions {
    display: flex;
    justify-content: flex-end;
}

.like-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
}

.star-icon {
    width: 20px;
    height: 20px;
    filter: grayscale(1) brightness(2);
    /* White appearance */
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.like-btn.liked .star-icon {
    filter: none;
    /* Colored appearance */
    transform: scale(1.2);
}

.like-btn.liked {
    color: var(--star-active);
}

/* Profile View */
.profile-header {
    text-align: center;
    margin-bottom: 32px;
}

.avatar-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--accent-color), #818cf8);
}

#user-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-color);
}

#user-name {
    font-size: 24px;
    font-weight: 700;
}

#user-username {
    color: var(--text-secondary);
    font-size: 16px;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    padding: 24px;
    background: var(--card-bg);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.blur-value {
    filter: blur(8px);
    transition: 0.3s;
    user-select: none;
    /* Prevent selection */
    pointer-events: none;
    /* Prevent interaction when blurred */
}

#count-stars {
    user-select: none;
    /* Always prevent copying of stars for everyone */
}



/* Bottom Nav */
#bottom-nav {
    width: 100%;
    background: #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 1px solid var(--glass-border);
    padding: 32px 20px 60px;
    margin-top: 40px;
}

/* Search Bar */
.search-container {
    position: relative;
    width: 100%;
    margin-bottom: 24px;
    animation: slideDown 0.3s ease;
}

.search-container.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


#search-input {
    width: 100%;
    background: #111111;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: 0.3s;
}

#search-input:focus {
    background: #000000;
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #000000;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    cursor: pointer;
    transition: 0.2s;
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.search-item .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--glass-border);
}

.search-item .info {
    flex: 1;
}

.search-item .name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-item .username {
    font-size: 12px;
    color: var(--text-secondary);
}

.search-results.hidden {
    display: none;
}


.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 24px;
}

/* Info Pages */
.info-page {
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    margin-bottom: 20px;
}

.info-page h2 {
    font-size: 22px;
    margin-bottom: 16px;
    color: var(--accent-color);
}

/* Settings Page */
.settings-page {
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
}

.input-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-color);
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

.btn-primary:active {
    transform: scale(0.98);
}


.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: 0.3s;
}

.footer-links a:hover {
    color: var(--accent-color);
}

#bottom-nav {
    margin-top: auto;
    padding: 32px 20px 60px;
    /* Enhanced padding to space it out nicely */
    background: #000000;
    width: 100%;
    border-top: 1px solid var(--glass-border);
}

.footer-copy {
    color: #475569;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-align: center;
}

/* Toast Notification */
#toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.95);
    color: var(--text-primary);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    text-align: center;
    white-space: nowrap;
}

#toast.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
    pointer-events: none;
}

/* Notifications */
.view-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: 0.2s;
}

.notification-item.unread {
    background: rgba(56, 189, 248, 0.05);
    border-color: rgba(56, 189, 248, 0.3);
}

.notification-item .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.notification-item .content {
    flex: 1;
    font-size: 14px;
}

.notification-item .name {
    font-weight: 700;
    color: var(--text-primary);
}

.notification-item .text {
    color: var(--text-secondary);
}

.notification-item .time {
    font-size: 11px;
    color: #475569;
    margin-top: 2px;
}

/* Post Details & Comments */
.post-details-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.header-actions h2 {
    font-size: 20px;
    font-weight: 700;
}

.comments-section {
    margin-top: 20px;
}

.comments-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--glass-border);
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-user {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.comment-text {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
}

.comment-actions {
    margin-top: 6px;
}

.comment-like-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 0;
}

.comment-like-btn.liked {
    color: var(--star-active);
}

.comment-input-area {
    position: sticky;
    bottom: 20px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-top: auto;
}

#comment-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: none;
    max-height: 80px;
}

/* Feed: Best Comment Preview */
.best-comment-preview {
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    position: relative;
    cursor: pointer;
    border-left: 2px solid var(--accent-color);
}

.best-comment-preview .user {
    font-weight: 700;
    margin-right: 4px;
}

.best-comment-preview .text {
    color: var(--text-secondary);
}

.best-comment-preview .best-like {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--text-secondary);
}