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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

a {
    color: #dc2626;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #b91c1c;
    text-decoration: underline;
}

/* Header */
header {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    max-width: 100%;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.logo a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
}

.search-bar input {
    width: 100%;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-bar input:focus {
    outline: none;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.nav-icons {
    display: flex;
    align-items: center;
}

.nav-icon {
    margin-left: 15px;
    cursor: pointer;
    color: white;
    padding: 10px;
    border-radius: 50%;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
}

.nav-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    /* transform: translateY(-1px); KALDIRILDI */
}

.nav-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* Tab Navigation */
.tab-nav {
    background: white;
    border-bottom: 1px solid #f3f4f6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tab-nav .container {
    max-width: 100%;
    margin: 0 auto;
}

.tab-nav-wrapper {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: center;
}

.tab-nav-wrapper::-webkit-scrollbar {
    display: none;
}

.tab-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-item.active {
    color: #dc2626;
    border-bottom: 3px solid #dc2626;
    background: linear-gradient(180deg, transparent 0%, rgba(220, 38, 38, 0.05) 100%);
}

.tab-item:hover:not(.active) {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.03);
}

.tab-item svg {
    margin-right: 8px;
}

/* Main Content */
.content-grid {
    display: grid;
    grid-template-columns: 22% minmax(0, 1fr) 25%;
    gap: 25px;
    margin: 20px auto;
    max-width: 100%;
    align-items: start;
}

.left-sidebar .sidebar,
.right-sidebar .sidebar {
    position: sticky;
    top: 100px;
}

/* Sidebar */
.sidebar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(220, 38, 38, 0.1);
    font-weight: bold;
    font-size: 13px;
}

.sidebar h3 {
    font-size: 15px;
    margin-bottom: 15px;
    color: #dc2626;
    padding-bottom: 10px;
    border-bottom: 2px solid #fecaca;
    font-weight: bold;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.sidebar-item:last-child {
    margin-bottom: 0;
}

.sidebar-item:hover {
    background-color: #f3f4f6;
    color: #dc2626;
}

.sidebar-item img {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    margin-right: 12px;
    object-fit: cover;
    border: 2px solid #fecaca;
}

.sidebar-item>div {
    flex: 1;
}

.sidebar-meta {
    font-size: 12px;
    color: #9ca3af;
}

.sidebar-title-with-arrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

/* Sidebar Menu (PHP güncellemesiyle gelen yeni kısım - Orijinal temaya uyarlandı) */
.sidebar-menu {
    margin-bottom: 20px;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 13px;
}

.sidebar-menu li a:hover {
    background-color: rgba(220, 38, 38, 0.05);
    color: #dc2626;
}

.sidebar-menu li a.active {
    background-color: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
    font-weight: bold;
}

.sidebar-menu li a svg {
    margin-right: 10px;
    color: inherit;
}

/* Premium Menu */
.premium-menu {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 140, 0, 0.1) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Buttons */
.btn,
.follow-btn,
.join-btn,
.btn-register {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.3);
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn:hover,
.follow-btn:hover,
.join-btn:hover,
.btn-register:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    /* transform: translateY(-1px); KALDIRILDI */
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid #dc2626;
    color: #dc2626;
    box-shadow: none;
}

.btn-outline:hover {
    background: #dc2626;
    color: white;
}

/* Most Read Books Slider */
.most-read-books {
    background: linear-gradient(135deg, white 0%, #fef7f7 100%);
    border-radius: 15px;
    box-shadow: 0 6px 25px rgba(220, 38, 38, 0.1);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(220, 38, 38, 0.1);
}

.most-read-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #dc2626;
    font-weight: 600;
    text-align: center;
}

.books-slider-container {
    overflow: hidden;
    border-radius: 10px;
}

.books-slider {
    display: flex;
    animation: slide 25s linear infinite;
}

@keyframes slide {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.book-item {
    min-width: 130px;
    margin-right: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.book-item:hover {
    /* transform: translateY(-5px); KALDIRILDI */
}

.book-cover {
    width: 110px;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    border: 2px solid #fecaca;
    transition: box-shadow 0.3s ease;
}

.book-cover:hover {
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.25);
    /* Gölge biraz yumuşatıldı */
}

.book-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #374151;
}

.sidebar .book-title {
    font-size: 13px;
}

.book-author {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

/* Post Card */
.post-card,
.alinti-card {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.post-card:hover,
.alinti-card:hover {
    /* transform: translateY(-2px); KALDIRILDI */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    /* Gölge yumuşatıldı */
}

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

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

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

.post-username {
    font-weight: 600;
    color: #374151;
    text-decoration: none;
}

.post-meta {
    font-size: 12px;
    color: #9ca3af;
}

.post-options {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.post-options:hover {
    background: rgba(220, 38, 38, 0.1);
}

.post-options-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    z-index: 10;
    padding: 5px 0;
    border: 1px solid #eee;
}

.post-options-menu.active {
    display: block;
}

.post-options-menu-item {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
    cursor: pointer;
}

.post-options-menu-item:hover {
    background: #f8f9fa;
    color: #dc2626;
}

.post-options-menu-item svg {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    color: #666;
}

.post-options-divider {
    height: 1px;
    background: #eee;
    margin: 5px 0;
}

.post-content {
    padding: 0 10px;
    margin-top: 10px;
}

.post-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #111827;
    display: block;
    text-decoration: none;
}

.post-text {
    margin-bottom: 15px;
    color: #4b5563;
    line-height: 1.7;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.post-image {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Video Responsive */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin-bottom: 15px;
    border-radius: 10px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.post-actions {
    display: flex;
    border-top: 1px solid #f3f4f6;
    padding: 12px 0;
    margin-top: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #6b7280;
    cursor: pointer;
    flex: 1;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 5px;
}

.action-btn:hover {
    background: rgba(220, 38, 38, 0.05);
    color: #dc2626;
    /* transform: translateY(-1px); KALDIRILDI */
}

.action-btn.active {
    color: #dc2626;
}

.action-btn.active svg {
    fill: #dc2626;
}

.action-btn svg {
    margin-right: 6px;
}

/* Alıntı Kartı Özel */
.alinti-content {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
    font-style: italic;
    border-left: 3px solid #dc2626;
    padding-left: 15px;
}

.alinti-book-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.alinti-book-cover {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin: 40px 0;
    gap: 8px;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: white;
    color: #374151;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    text-decoration: none;
}

.page-btn.active {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.page-btn:hover:not(.active) {
    background: #f9fafb;
    color: #dc2626;
    /* transform: translateY(-1px); KALDIRILDI */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
    padding: 50px 0 30px;
    margin-top: 50px;
}

.footer-content {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 15px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-column h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #dc2626;
    font-weight: 600;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #d1d5db;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #dc2626;
    text-decoration: none;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #374151;
    font-size: 14px;
    color: #9ca3af;
    max-width: 100%;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Profil Sayfası Özel */
.profile-header {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    overflow: hidden;
}

.cover-photo {
    height: 300px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.profile-info-container {
    display: flex;
    padding: 0 20px 20px;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid #ffffff;
    background-color: #eee;
    object-fit: cover;
    margin-top: -75px;
    z-index: 10;
}

.profile-info {
    flex: 1;
    padding-left: 20px;
    padding-top: 10px;
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
}

.profile-stats {
    display: flex;
    margin-bottom: 15px;
}

.profile-stat {
    margin-right: 20px;
    cursor: pointer;
}

.profile-stat-value {
    font-weight: 800;
    font-size: 12px;
}

.profile-stat-label {
    color: #606770;
    font-size: 10px;
}

.profile-tabs {
    display: flex;
    margin: 0 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 0px;
    font-weight: 600;
    color: #65676b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-right: 20px;
    text-decoration: none;
}

.tab:hover {
    background-color: #f0f2f5;
}

.tab.active {
    color: #dc2626;
    border-bottom: 3px solid #dc2626;
}

/* Modal */
.custom-modal {
    display: none;
    position: fixed;
    z-index: 2050;
    /* Sidebar'ın (2000) üzerinde olması için artırıldı */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.custom-modal.active {
    display: block;
}

.custom-modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
}

.custom-modal-body {
    padding: 15px;
}

/* Responsive */
@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .left-sidebar,
    .right-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        padding: 10px 0;
    }

    .search-bar {
        order: 3;
        flex-basis: 100%;
        margin: 10px 0 0;
    }

    .profile-info-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-info {
        padding-left: 0;
    }

    .profile-avatar {
        margin-top: -50px;
    }
}

/* Mobil Sidebar Toggle (Yeni eklenen özellikler için) */
.mobile-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: white;
    cursor: pointer;
    margin-left: 10px;
}

@media (max-width: 992px) {
    .mobile-sidebar-toggle {
        display: block;
    }

    .left-sidebar {
        position: fixed !important;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background: white;
        z-index: 2000;
        transition: left 0.3s ease;
        padding: 20px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        display: block !important;
        overflow-y: auto;
    }

    .left-sidebar.active {
        left: 0;
    }

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

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1999;
}

.sidebar-overlay.active {
    display: block;
}

/* Oluştur Menüsü */
.create-menu-container {
    position: relative;
    display: inline-block;
}

.create-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 5px;
}

.create-menu-dropdown.show {
    display: block;
}

.create-menu-dropdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.create-menu-dropdown li a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
    font-size: 13px;
    font-weight: bold;
}

.create-menu-dropdown li a:hover {
    background-color: #f1f1f1;
}

.create-menu-dropdown li a i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
    color: #dc2626;
}

#create-menu-toggle {
    background-color: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

/* Sol, Orta ve Sağ Alanlar İçin Bağımsız Scroll (Desktop) */
@media (min-width: 992px) {
    main {
        /* Header (~70px) + TabNav (~55px) + Boşluklar (~20px) = ~145px */
        height: calc(100vh - 145px);
        margin-top: 10px;
    }

    .container {
        height: 100%;
    }

    .content-grid {
        height: 100%;
        align-items: stretch;
        margin-top: 0;
        padding-bottom: 0;
    }

    .left-sidebar,
    .main-content,
    .right-sidebar {
        height: 100%;
        overflow-y: auto;
        /* Her sütuna kendi scrollbarını ver */
        padding-right: 5px;
        padding-bottom: 20px;
        scrollbar-width: thin;
    }

    /* Orta kısım scrollbar gizleme (Kaydırma devam eder, çubuk görünmez) */
    .main-content {
        scrollbar-width: none;
        /* Firefox */
    }

    .main-content::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari, Opera */
    }

    /* Scrollbar Görünümü */
    .left-sidebar::-webkit-scrollbar,
    .right-sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .left-sidebar::-webkit-scrollbar-thumb,
    .right-sidebar::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 4px;
    }

    /* Mevcut sticky özellikleri iptal et */
    .left-sidebar .sidebar,
    .right-sidebar .sidebar {
        position: static;
    }

    /* Bu görünümde footer erişilemez olacağı için gizliyoruz */
    footer {
        display: none;
    }
}

/* Sonsuz Kaydırma Yükleniyor Animasyonu */
.loading-spinner {
    text-align: center;
    padding: 20px;
    display: none;
    width: 100%;
    clear: both;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Bootstrap Modal Z-Index Düzeltmesi */
.modal-backdrop {
    z-index: 10500 !important;
    /* Çok yüksek değer */
}

.modal {
    z-index: 10550 !important;
    /* Backdrop'un üzerinde */
}