/* Modern Ekşi Sözlük Clone Styles */
:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --primary-color: #81c784;
    /* Soft Green */
    --accent-color: #4caf50;
    --text-color: #c7c7c7;
    --text-muted: #a0a0a0;
    --border-color: #333333;
    --danger-color: #ef5350;
    --font-family: 'Inter', sans-serif;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
    --header-border: rgba(255, 255, 255, 0.05);
}

/* Light Mode - primary-color site ayarından gelir (header.php) */
:root[data-theme="light"] {
    --bg-color: #f5f5f5;
    --surface-color: #ffffff;
    --accent-color: #66bb6a;
    --text-color: #212121;
    --text-muted: #757575;
    --border-color: #e0e0e0;
    --danger-color: #f44336;
    --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --header-border: rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    line-height: 1.6;
    text-transform: lowercase;
}

input,
textarea,
button,
select {
    text-transform: lowercase;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 260px 1fr 260px;
    gap: 20px;
    min-height: calc(100vh - 120px);
}

/* Header */
header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    border-bottom: 1px solid var(--header-border);
    padding: 10px 0;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Channel Navigation (Subheader) */
.channel-nav {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    overflow-x: auto;
    overflow-y: visible;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll on iOS */
}

.channel-nav::-webkit-scrollbar {
    height: 4px;
}

.channel-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.channel-list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 20px;
    list-style: none;
    position: static;
}

.channel-list li {
    padding: 10px 0;
}

.channel-list a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.channel-list a svg {
    opacity: 0.7;
    transition: var(--transition);
}

.channel-list a:hover,
.channel-list a.active {
    color: var(--primary-color);
}

.channel-list a:hover svg,
.channel-list a.active svg {
    opacity: 1;
    color: var(--primary-color);
}

/* Channel visibility */
.mobile-channel {
    display: none;
}

/* Channel Dropdown */
.channel-dropdown {
    position: relative;
}

.channel-dropdown .dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    user-select: none;
}

.channel-dropdown .dropdown-menu,
.channel-menu-repositioned {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    list-style: none;
    padding: 8px 0;
    margin: 0;
    min-width: 220px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}



.channel-dropdown:hover .dropdown-menu,
.channel-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.channel-dropdown .dropdown-menu li,
.channel-menu-repositioned li {
    padding: 0;
}

.channel-dropdown .dropdown-menu a,
.channel-menu-repositioned a {
    display: block;
    padding: 10px 16px;
    color: var(--text-muted);
    white-space: nowrap;
    transition: var(--transition);
    font-size: 0.9rem;
}

.channel-dropdown .dropdown-menu a:hover,
.channel-dropdown .dropdown-menu a.active,
.channel-menu-repositioned a:hover,
.channel-menu-repositioned a.active {
    background-color: rgba(129, 199, 132, 0.1);
    color: var(--primary-color);
}

.channel-dropdown .dropdown-toggle svg {
    transition: transform 0.3s ease;
}

.channel-dropdown:hover .dropdown-toggle svg,
.channel-dropdown.active .dropdown-toggle svg {
    transform: rotate(180deg);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.mobile-search-toggle {
    display: none !important;
}

.search-bar {
    flex-grow: 1;
    margin: 0 40px;
    position: relative;
    max-width: 500px;
}

.search-bar input {
    width: 100%;
    padding: 8px 15px;
    border-radius: 20px;
    /* Daha yuvarlak */
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    outline: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(129, 199, 132, 0.1);
}

.user-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: center;
}

.btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-size: 0.85rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--accent-color);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 8px;
}

.btn-outline:hover {
    border-color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px !important;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.btn-icon svg {
    display: block;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 40px;
    height: 40px;
    overflow: hidden;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
}

.theme-toggle svg {
    position: absolute;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

[data-theme="dark"] .sun-icon {
    transform: translateY(30px) rotate(45deg);
    opacity: 0;
}

[data-theme="dark"] .moon-icon {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
}

[data-theme="light"] .sun-icon {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
}

[data-theme="light"] .moon-icon {
    transform: translateY(-30px) rotate(-45deg);
    opacity: 0;
}

/* Sidebar Tabs */
.sidebar-widget {
    background-color: #1e1e1e00;
    border-radius: 8px;
    padding: 0;
    border: 0px solid var(--border-color);
    overflow: hidden;
}

.sidebar-tabs {
    display: flex;
    gap: 0;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--surface-color);
}

.sidebar-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.sidebar-tab:hover {
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.03);
}

.sidebar-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: rgba(129, 199, 132, 0.05);
}

.tab-content {
    display: none;
    padding: 0px;
    max-height: 600px;
    overflow-y: auto;
}

.tab-content::-webkit-scrollbar {
    width: 6px;
}

.tab-content::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.tab-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 20px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 25px;
}

.profile-tab {
    background: none;
    border: none;
    padding: 10px 0;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

.profile-tab:hover {
    color: var(--text-color);
}

.profile-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.topic-list-sidebar {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topic-list-sidebar li {
    padding: 10px 10px 10px 0px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    transition: var(--transition);
}

.topic-list-sidebar li:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.topic-list-sidebar li:last-child {
    border-bottom: none;
}

.topic-list-sidebar a {
    color: var(--text-color);
    font-size: 0.85rem;
    display: block;
    line-height: 1.4;
    font-weight: 500;
    text-decoration: none;
    flex: 1;
}

.topic-list-sidebar a:hover {
    color: var(--primary-color);
}

.topic-list-sidebar .entry-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    white-space: nowrap;
}

/* Sidebar (Left) */
.sidebar-left {
    padding-top: 20px;
    position: sticky;
    top: 110px;
    height: calc(100vh - 110px);
    overflow-y: auto;
    padding-left: 0;
    padding-right: 6px;
    padding-bottom: 20px;
}

.sidebar-left::-webkit-scrollbar {
    width: 5px;
}

.sidebar-left::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-left::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar-left::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    color: var(--text-muted);
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: rgba(129, 199, 132, 0.1);
    color: var(--primary-color);
}

/* Main Content (Middle) */
.main-content {
    padding-top: 20px;
}

.topic-header {
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.topic-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
    line-height: 1.3;
}
/*
.entry-card.old {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}
*/

.entry-card {
    background-color: #ffffff00;
    border-radius: 12px;
    padding-bottom: 0;
    margin-bottom: 28px;
    box-shadow: none;
    border: none;
}

.entry-content {
    font-size: 0.95rem;
    margin-bottom: 15px;
    word-wrap: break-word;
    line-height: 1.5;
}

.entry-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--header-border);
    padding-top: 10px;
}

.vote-actions {
    display: flex;
    gap: 12px;
}

/* Entry kartı üç nokta menüsü */
.entry-actions-dropdown {
    position: relative;
    display: inline-block;
}
.entry-menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 1.1rem;
    line-height: 1;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.entry-menu-btn:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}
.entry-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    min-width: 140px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    z-index: 100;
    overflow: hidden;
}
.entry-actions-dropdown.open .entry-menu-dropdown {
    display: block;
}
.entry-menu-dropdown a {
    display: block;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: var(--text-color);
    text-decoration: none;
    text-transform: lowercase;
    border-bottom: 1px solid var(--border-color);
}
.entry-menu-dropdown a:last-child {
    border-bottom: none;
}
.entry-menu-dropdown a:hover {
    background: rgba(255, 255, 255, 0.05);
}
.entry-menu-dropdown a.entry-menu-delete {
    color: var(--danger-color);
}

.vote-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
    font-size: 0.85rem;
    padding: 2px 5px;
    border-radius: 4px;
}

.vote-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--primary-color);
}

.vote-btn.down:hover {
    color: var(--danger-color);
}

.vote-btn.active {
    color: var(--primary-color);
    font-weight: bold;
}

.fav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    padding: 2px 5px;
    border-radius: 4px;
}

.fav-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffca28;
    /* Gold color */
}

.fav-btn.active {
    color: #ffca28;
}

/* Sidebar (Right - Trends/Channels) */
.sidebar-right {
    padding-top: 20px;
}

.widget {
    background-color: var(--surface-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.widget-title {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topic-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topic-list li {
    margin-bottom: 10px;
    border-bottom: 1px solid var(--header-border);
    padding-bottom: 10px;
}

.topic-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.topic-list a {
    display: block;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.topic-list span {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

/* Forms */
.auth-form {
    max-width: 400px;
    margin: 40px auto;
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    outline: none;
    font-family: var(--font-family);
    box-sizing: border-box;
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 900px) {
    .desktop-channel { display: none; }
    .mobile-channel { display: block; }

    .container {
        grid-template-columns: 1fr;
    }

    .sidebar-left,
    .sidebar-right {
        display: none;
    }

    .main-content {
        padding-top: 15px;
    }

    .channel-list {
        padding-bottom: 5px;
    }


    .search-bar {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin: 0;
        padding: 10px 20px;
        background: var(--surface-color);
        border-bottom: 1px solid var(--border-color);
        max-width: none;
        display: none;
        z-index: 100;
    }

    .search-bar.active {
        display: block;
    }

    .mobile-search-toggle {
        display: inline-flex !important;
        /* Remove extra padding to match user-actions flex items */
    }


    .logo {
        font-size: 1.8rem;
    }

    /* Hide specific header actions on mobile */
    .user-actions a[href*="messages.php"],
    .user-actions a[href*="/mesajlar"],
    .user-actions a[href*="/u/"],
    /* Profiles */
    .user-actions a[href$="login.php"],
    .user-actions a[href$="register.php"],
    .user-actions a[href*="create.php"] {
        display: none !important;
    }
}

@media (max-width: 900px) {
    .hide-on-mobile {
        display: none !important;
    }
}

/* Profile Specific Styles */
.profile-header-card {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.profile-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar-container {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.profile-avatar-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #121212;
    font-weight: bold;
}

.avatar-upload-form {
    position: absolute;
    bottom: 0;
    right: -5px;
}

.avatar-upload-label {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.profile-username {
    margin: 0;
    font-size: 2rem;
}

.profile-generation {
    color: var(--text-muted);
    margin: 5px 0;
    font-weight: 500;
}

.profile-stats-row {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    align-items: center;
}

.profile-stat-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.profile-bio {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    line-height: 1.6;
    color: var(--text-color);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Entry Editor Toolbar */
.entry-toolbar {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.toolbar-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Entry Formatting */
.entry-spoiler-text {
    background: #444;
    color: #444;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 2px;
    transition: all 0.2s;
}

.entry-spoiler-text:hover {
    background: #555;
}

.entry-spoiler-text.visible {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border: 1px dashed var(--border-color);
}

.entry-image-container {
    margin: 10px 0;
    max-width: 100%;
}

.entry-image {
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
    cursor: zoom-in;
    border: 1px solid var(--border-color);
}

/* Video Embedding */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid var(--border-color);
}

.video-wrapper iframe,
.video-wrapper object,
.video-wrapper embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}