:root {
    --primary-color: #1d9bf0;
    --primary-hover: #1a8cd8;
    --bg-color: #ffffff;
    --border-color: #eff3f4;
    --text-main: #0f1419;
    --text-muted: #536471;
    --ted-red: #e62b1e;
    --verified-blue: #1d9bf0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* Auth Container */
#auth-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.logo-text {
    font-size: 48px;
    font-weight: 800;
    color: var(--ted-red);
    margin-bottom: 20px;
}

.auth-header h1:not(.logo-text) {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input,
select {
    padding: 12px 16px;
    border: 1px solid #cfd9de;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border 0.2s;
}

input:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.1);
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-muted);
}

.btn-primary {
    background-color: var(--text-main);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: #272c30;
}

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

.auth-switch {
    margin-top: 20px;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* App Layout */
#app-container {
    display: flex;
    max-width: 1250px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 275px;
    padding: 0 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.logo-container {
    padding: 12px;
}

.sidebar-logo-text {
    font-size: 24px;
    font-weight: 800;
    color: var(--ted-red);
    letter-spacing: -0.5px;
}

nav {
    margin-top: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 30px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 20px;
    transition: background 0.2s;
    margin-bottom: 4px;
}

.nav-item i {
    width: 30px;
    margin-right: 15px;
}

.nav-item span {
    font-weight: 400;
}

.nav-item.active span {
    font-weight: 700;
}

.nav-item:hover {
    background-color: rgba(15, 20, 25, 0.1);
}

.btn-post {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 90%;
    padding: 15px;
    border-radius: 30px;
    font-size: 17px;
    font-weight: 700;
    margin-top: 15px;
    cursor: pointer;
}

.user-pill {
    margin-top: auto;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 40px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-pill:hover {
    background-color: rgba(15, 20, 25, 0.1);
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    margin-right: 12px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.user-info .display-name {
    font-weight: 700;
}

.user-info .username {
    color: var(--text-muted);
    font-size: 15px;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--ted-red);
    padding: 10px;
    cursor: pointer;
    font-weight: 600;
    text-align: left;
    margin-bottom: 15px;
}

/* Main Content */
.main-content {
    flex: 1;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    max-width: 600px;
}

.main-header {
    padding: 16px;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

.main-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.post-input-container {
    padding: 16px;
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.input-wrapper {
    flex: 1;
}

textarea {
    width: 100%;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 20px;
    resize: none;
    min-height: 100px;
    margin-bottom: 12px;
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.input-actions .icons {
    display: flex;
    gap: 15px;
    color: var(--primary-color);
    font-size: 18px;
}

.input-actions .icons i {
    cursor: pointer;
}

/* Feed */
.post {
    padding: 16px;
    display: flex;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.post:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.post-content {
    flex: 1;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
}

.display-name {
    font-weight: 700;
}

.verified-icon {
    color: var(--verified-blue);
    font-size: 14px;
}

.post-username,
.post-date {
    color: var(--text-muted);
}

.post-text {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    max-width: 425px;
    color: var(--text-muted);
}

.post-action {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.post-action:hover {
    color: var(--primary-color);
}

.post-action.like-btn.liked {
    color: #f91880;
}

.post-action.like-btn:hover {
    color: #f91880;
}

/* Right Sidebar */
.right-sidebar {
    width: 350px;
    padding: 12px 20px;
    display: none;
}

@media (min-width: 1000px) {
    .right-sidebar {
        display: block;
    }
}

.search-container {
    background-color: #eff3f4;
    border-radius: 30px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.search-container i {
    color: var(--text-muted);
    margin-right: 12px;
}

.search-container input {
    background: none;
    border: none;
    padding: 0;
    font-size: 15px;
    width: 100%;
}

.trends-box,
.who-to-follow {
    background-color: #f7f9f9;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.trends-box h3,
.who-to-follow h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 16px;
}

.trend-item {
    margin-bottom: 16px;
    cursor: pointer;
}

.trend-item span {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
}

.trend-item strong {
    display: block;
    font-size: 15px;
}

.follow-item {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.follow-item .info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.btn-follow {
    background-color: var(--text-main);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 50px;
    z-index: 100;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    padding: 16px;
}

.modal-header {
    display: flex;
    justify-content: flex-start;
    padding-bottom: 16px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.reply-input-area {
    display: flex;
    padding: 16px 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

/* Replies in Feed */
.reply-to {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 5px;
}

.reply-to span {
    color: var(--primary-color);
}

.post-replies {
    margin-left: 52px;
    border-left: 2px solid var(--border-color);
}

/* Messages System Styles */
.messages-container {
    display: flex;
    height: calc(100vh - 53px);
}

.messages-sidebar {
    width: 40%;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

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

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-main);
}

.conversation-item {
    display: flex;
    padding: 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.conversation-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.conv-info {
    flex: 1;
    overflow: hidden;
}

.conv-header {
    display: flex;
    gap: 4px;
    align-items: center;
}

.conv-header span {
    color: var(--text-muted);
    font-size: 14px;
}

.conv-last-msg {
    color: var(--text-muted);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-view {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.no-message-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    padding: 20px;
    text-align: center;
}

.chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
}

.message-bubble.sent {
    align-self: flex-end;
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble.received {
    align-self: flex-start;
    background-color: #eff3f4;
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}

.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.chat-input-area input {
    flex: 1;
    background-color: #eff3f4;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
}

#send-msg-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 20px;
    cursor: pointer;
}

.new-msg-search {
    padding: 16px;
}

.new-msg-search input {
    width: 100%;
    margin-bottom: 16px;
}

.search-result-item {
    padding: 12px;
    cursor: pointer;
    border-radius: 8px;
}

.search-result-item:hover {
    background-color: #eff3f4;
}

.conversation-item.active {
    background-color: rgba(0, 0, 0, 0.05);
    border-right: 2px solid var(--primary-color);
}

/* Profile Styles */
.profile-banner {
    background-color: #cfd9de;
    height: 200px;
    width: 100%;
}

.profile-info-section {
    padding: 12px 16px;
    position: relative;
}

.profile-avatar-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: -70px;
    margin-bottom: 20px;
}

.profile-large-avatar {
    width: 140px !important;
    height: 140px !important;
    font-size: 60px;
    border: 4px solid white;
}

.profile-names .display-name {
    font-size: 20px;
    font-weight: 800;
}

.profile-names .username {
    color: var(--text-muted);
}

.profile-meta {
    margin-top: 12px;
    display: flex;
    gap: 15px;
    color: var(--text-muted);
    font-size: 15px;
}

.profile-stats {
    margin-top: 12px;
    display: flex;
    gap: 20px;
    font-size: 15px;
}

.profile-stats strong {
    color: var(--text-main);
}

.profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-top: 4px;
}

.profile-tabs .tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.2s;
}

.profile-tabs .tab:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.profile-tabs .tab.active {
    color: var(--text-main);
    border-bottom: 4px solid var(--primary-color);
}

.btn-follow-large {
    background-color: var(--text-main);
    color: white;
    border: 1px solid var(--text-main);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-follow-large.following {
    background-color: white;
    color: var(--text-main);
    border: 1px solid #cfd9de;
}

.btn-follow-large.following:hover {
    background-color: #feeaee;
    color: #f4212e;
    border-color: #fdb9bc;
}

.btn-edit-profile {
    background-color: white;
    color: var(--text-main);
    border: 1px solid #cfd9de;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-edit-profile:hover {
    background-color: #eff3f4;
}

.profile-bio {
    margin-top: 12px;
    font-size: 15px;
    line-height: 20px;
}


/* Notifications Styles */
.notification-item {
    display: flex;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    gap: 12px;
}

.notification-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.notif-icon {
    font-size: 24px;
    width: 40px;
    display: flex;
    justify-content: center;
}

.notif-icon.like {
    color: #f91880;
}

.notif-icon.reply {
    color: var(--primary-color);
}

.notif-icon.follow {
    color: var(--primary-color);
}

.notif-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avatar-small {
    width: 32px;
    height: 32px;
    background-color: #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 14px;
}

.notif-text {
    font-size: 15px;
    color: var(--text-main);
}

/* Edit Profile Modal Styles Redesign */
.edit-modal-content {
    max-width: 600px;
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.header-left h3 {
    font-size: 20px;
    font-weight: 700;
}

.btn-save-profile {
    background-color: var(--text-main);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.edit-profile-body {
    max-height: 80vh;
    overflow-y: auto;
}

.edit-banner {
    background-color: #cfd9de;
    height: 190px;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-overlay,
.upload-overlay {
    width: 44px;
    height: 44px;
    background: rgba(15, 20, 25, 0.75);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.banner-overlay:hover,
.upload-overlay:hover {
    background: rgba(38, 44, 48, 0.75);
}

.edit-avatar-section {
    position: relative;
    width: 112px;
    height: 112px;
    margin-top: -56px;
    margin-left: 16px;
    margin-bottom: 24px;
}

.edit-large-avatar {
    width: 100% !important;
    height: 100% !important;
    border: 4px solid white;
    background-size: cover;
    background-position: center;
}

.edit-avatar-section .upload-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.edit-fields {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.floating-label {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 8px 4px 8px;
    transition: border-color 0.2s;
}

.floating-label:focus-within {
    border-color: var(--primary-color);
    border-width: 2px;
    padding: 7px 7px 3px 7px;
}

.floating-label label {
    position: absolute;
    top: 12px;
    left: 8px;
    font-size: 17px;
    color: var(--text-muted);
    transition: all 0.2s;
    pointer-events: none;
}

.floating-label input:focus+label,
.floating-label input:not(:placeholder-shown)+label,
.floating-label textarea:focus+label,
.floating-label textarea:not(:placeholder-shown)+label {
    top: 4px;
    font-size: 13px;
    color: var(--primary-color);
}

.floating-label input,
.floating-label textarea {
    width: 100%;
    border: none;
    outline: none;
    font-size: 17px;
    padding-top: 14px;
    background: transparent;
}

.floating-label textarea {
    height: 80px;
    resize: none;
}

.avatar {
    background-size: cover;
    background-position: center;
}

/* Post Options Menu */
.post-header {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.post-options {
    position: absolute;
    right: 0;
    top: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
}

.post-options:hover {
    background-color: rgba(29, 155, 240, 0.1);
    color: var(--primary-color);
}

.options-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 4px;
    box-shadow: rgba(101, 119, 134, 0.2) 0px 0px 15px, rgba(101, 119, 134, 0.15) 0px 0px 3px 1px;
    z-index: 100;
    width: 120px;
    overflow: hidden;
}

.options-menu div {
    padding: 12px 16px;
    font-size: 15px;
    color: #f4212e;
    /* Red for delete */
    display: flex;
    align-items: center;
    gap: 12px;
}

.options-menu div:hover {
    background-color: #f7f7f7;
}

/* --- Improved Mobile Redesign --- */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
}

.mobile-nav-item {
    color: var(--text-main);
    font-size: 24px;
    text-decoration: none;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

.mobile-nav-item.active {
    color: var(--ted-red);
}

.mobile-nav-item:active {
    transform: scale(0.9);
}

.mobile-login-prompt {
    display: none;
    background-color: var(--ted-red);
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: 700;
    cursor: pointer;
    position: sticky;
    top: 0;
    z-index: 110;
}

@media (max-width: 700px) {
    .sidebar {
        display: none;
    }

    .right-sidebar {
        display: none !important;
    }

    #app-container {
        display: block;
        padding-bottom: 60px;
    }

    .main-content {
        width: 100%;
        max-width: 100%;
        border: none;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    .mobile-login-prompt {
        display: block;
    }

    .main-header {
        position: sticky;
        top: 0; /* Will sit below login prompt if both visible */
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        z-index: 100;
    }

    /* Explore view on mobile uses the trends from right sidebar */
    .mobile-trends-container {
        padding: 16px;
    }
    
    .mobile-trends-container .trends-box {
        background: transparent;
        padding: 0;
    }

    .post-input-container {
        padding: 12px;
    }
}

/* --- Unified Desktop/Mobile Improvements --- */

/* Show login prompt on both desktop and mobile if not logged in */
.mobile-login-prompt {
    display: block; /* Overrides previous hidden state */
    background-color: var(--ted-red);
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: 700;
    cursor: pointer;
    position: sticky;
    top: 0;
    z-index: 110;
    width: 100%;
    transition: background 0.2s;
}

.mobile-login-prompt:hover {
    background-color: #c42318;
}

/* Ensure bottom nav is always available at bottom for both */
.mobile-bottom-nav {
    display: flex; /* Show on PC too as requested */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
}

/* Adjust layout to avoid overlapping with bottom nav */
#app-container {
    padding-bottom: 70px;
}

@media (min-width: 701px) {
    /* Optional: style bottom nav differently on large screens if desired, 
       but for now we keep it similar as requested "normalde olan tuşları alta ekleyelim" */
    .mobile-bottom-nav {
        max-width: 1250px;
        left: 50%;
        transform: translateX(-50%);
        border-right: 1px solid var(--border-color);
        border-left: 1px solid var(--border-color);
    }
}

