@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    --primary-color: #ff3366;
    /* KS Pembesi / Onedio Kırmızısı karşımı */
    --primary-hover: #e62e5c;
    --secondary-color: #3b82f6;
    /* Erkek/Genel Mavi Tonu */
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;

    /* Oylama Renkleri */
    --vote-haklisin: #10b981;
    --vote-haksizsin: #ef4444;
    --vote-ikiniz: #f59e0b;
    --vote-bilgi: #6366f1;
}

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

html,
body {
    width: 100%;
    overflow-x: clip;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* HEADER (STİCKY VE DİNAMİK) */
header {
    background: var(--card-bg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1.2rem 0;
    /* Biraz daha ferah */
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    flex-wrap: wrap;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -1px;
}

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

.nav-links {
    display: flex;
    gap: 2.5rem;
    /* Biraz daha ferah */
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1.05rem;
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
}

.nav-links a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* PAYLAŞ BUTONU (ORTADA, BÜYÜK) */
.btn-share-big {
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
}

.btn-share-big:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 51, 102, 0.5);
}

.btn-login {
    background: white;
    border: 2px solid var(--border-color);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-login:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: scale(1.05);
}

/* LAYOUT */
.container {
    max-width: 1200px;
    margin: 1rem auto;
    display: grid;
    grid-template-columns: 200px 1fr 280px;
    gap: 2rem;
    padding: 0 1rem;
    align-items: start; /* Sticky'nin çalışması için gerekli */
}

/* MENÜLERİN EKRANDA SABİT KALMASI */
.container > aside {
    position: sticky;
    top: 100px;
    height: max-content;
    z-index: 10;
}

/* KATEGORİ MENÜSÜ DARALTMA */
.category-list {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 0.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.category-list h3 {
    margin-bottom: 0.1rem;
    font-size: 0.95rem;
    padding-left: 0.2rem;
    color: var(--text-main);
}

.category-item {
    display: block;
    padding: 0.1rem 0.4rem;
    margin-bottom: 0;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 6px;
    transition: 0.2s;
    line-height: 1.05;
}

.category-item:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.category-item span {
    margin-right: 0.2rem;
    font-size: 0.85rem;
}

/* HİKAYE KARTLARI (BÜYÜK VE GÖLGELİ) */
.story-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 1.2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.story-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.2rem;
}

.avatar {
    width: 55px;
    height: 55px;
    background: #fdf2f8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-right: 1rem;
    border: 3px solid #fbcfe8;
    /* Varsayılan pembe border */
}

.avatar.erkek {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.user-info .username {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Xper / Level rozeti simülasyonu */
.user-level {
    background: #fcd34d;
    color: #92400e;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 800;
}

.user-info .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.category-badge {
    margin-left: auto;
    background: #f3f4f6;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
}

.story-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.story-title:hover {
    color: var(--primary-color);
}

.story-content {
    color: #4b5563;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* OYLAMA BUTONLARI (BÜYÜK VE RENKLİ) */
.story-actions {
    display: flex;
    gap: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: auto;
}

.btn-vote {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1rem;
}

.btn-vote:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-vote.haklisin {
    background: #d1fae5;
    color: #065f46;
}

.btn-vote.haklisin:hover {
    background: #a7f3d0;
}

.btn-vote.haksizsin {
    background: #fee2e2;
    color: #991b1b;
}

.btn-vote.haksizsin:hover {
    background: #fecaca;
}

.btn-vote.ikiniz {
    background: #fef3c7;
    color: #92400e;
}

.btn-vote.ikiniz:hover {
    background: #fde68a;
}

.btn-vote.bilgi {
    background: #e0e7ff;
    color: #3730a3;
}

.btn-vote.bilgi:hover {
    background: #c7d2fe;
}

/* İSTATİSTİK BAR RENKLERİ */
.stat-bar-bg {
    background: var(--border-color);
    border-radius: 8px;
    height: 10px;
    width: 100%;
    overflow: hidden;
    margin-top: 0.5rem;
}
.stat-bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.5s ease-in-out;
}
.fill-haklisin { background: var(--vote-haklisin); }
.fill-haksizsin { background: var(--vote-haksizsin); }
.fill-ikiniz { background: var(--vote-ikiniz); }
.fill-bilgi { background: var(--vote-bilgi); }


/* FEED KART BUTONLARI (ANA SAYFA İÇİN) */
.action-btn {
    flex: 1;
    background: #f3f4f6;
    border: none;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: #e5e7eb;
    color: var(--primary-color);
    transform: scale(1.03);
}

/* SAĞ & SOL MENÜLER */
.sidebar-left,
.sidebar-right {
    position: sticky;
    top: 90px;
    height: max-content;
}

.category-list {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.category-list h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.category-item span {
    font-size: 1.4rem;
    margin-right: 1rem;
}

.category-item:hover {
    background: #fdf2f8;
    color: var(--primary-color);
    transform: translateX(5px);
}

.widget {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.widget h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 0.5rem;
}

.trending-list {
    list-style: none;
}

.trending-list li {
    margin-bottom: 1rem;
}

.trending-list a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    display: block;
}

.trending-list a:hover {
    color: var(--primary-color);
}

.trending-meta {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-top: 0.3rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* RESPONSIVE / MOBİL UYUM */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 200px 1fr 250px;
        gap: 1.5rem;
    }

    .header-container {
        gap: 10px;
    }

    .nav-links {
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .container {
        display: flex;
        flex-direction: column;
        padding: 10px;
    }

    .container > aside,
    .sidebar-left,
    .sidebar-right {
        position: static !important;
        width: 100%;
        margin-bottom: 1rem;
    }

    /* Kategorileri yatay sığdır ve sarmala */
    .category-list {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        padding: 1rem;
        padding-bottom: 1.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    .category-list h3 {
        display: none;
    }

    .category-item {
        margin-bottom: 0;
        white-space: nowrap;
        background: #fff;
        border: 1px solid var(--border-color);
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
        padding: 10px;
        justify-content: space-between;
    }

    .nav-links {
        order: 3;
        width: 100%;
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
        border-top: 1px solid var(--border-color);
        padding-top: 10px;
    }

    .btn-share-big {
        order: 4;
        width: 100%;
        text-align: center;
    }

    .story-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .category-badge {
        margin-left: 0;
        margin-top: 10px;
    }

    .story-actions {
        flex-wrap: wrap;
    }

    .btn-vote {
        flex: 1 1 calc(50% - 10px);
        font-size: 0.9rem;
        padding: 0.6rem;
    }
}

@media (max-width: 480px) {
    .btn-vote {
        flex: 1 1 100%;
    }

    .story-title {
        font-size: 1.2rem;
    }

    .logo {
        font-size: 1.5rem;
    }
}

/* GECE MODU (DARK MODE) */
body.dark-mode {
    --bg-color: #111827;
    --card-bg: #1f2937;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --border-color: #374151;
}

body.dark-mode header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

body.dark-mode .story-card,
body.dark-mode .category-list,
body.dark-mode .widget {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .story-card:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

body.dark-mode .category-item {
    background: var(--card-bg);
    color: var(--text-main);
}

body.dark-mode .category-item:hover {
    background: #374151;
    /* Dark moda uyumlu hover rengi */
    transform: translateX(5px);
}

body.dark-mode .action-btn {
    background: #374151;
    color: var(--text-main);
}

body.dark-mode .action-btn:hover {
    background: #4b5563;
    color: var(--primary-color);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #374151;
    color: var(--text-main);
    border-color: var(--border-color);
}

/* Otomatik doldurma (Autofill) renk çakışmasını düzeltme */
body.dark-mode input:-webkit-autofill,
body.dark-mode input:-webkit-autofill:hover, 
body.dark-mode input:-webkit-autofill:focus, 
body.dark-mode input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #374151 inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    transition: background-color 5000s ease-in-out 0s;
}

body.dark-mode .btn-login {
    background: transparent;
    color: var(--text-main);
    border-color: var(--border-color);
}

body.dark-mode .btn-login:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Hikaye Grid Düzeni */
.story-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}
@media (max-width: 768px) {
    .story-grid {
        grid-template-columns: 1fr;
    }
}

/* Textarea placeholder rengini gece moduna daha uygun hale getirme */
textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}