/* Genel Ayarlar ve Fontlar */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap');

:root {
    --primary-green: #4CAF50; /* Yeşil buton ve skor */
    --negative-red: #E91E63; /* Kırmızı skor */
    --card-bg: #FFFFFF;
    --text-dark: #212121;
    --text-light: #757575;
    --border-color: #EEEEEE;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.1);
    --neutral-gray: #BDBDBD; /* Sıfır/Nötr Gri */
    --light-green-bg: #e8f5e9; /* Çok açık yeşil arka plan */
    --light-red-bg: #ffebee;   /* Çok açık kırmızı arka plan */
    --light-gray-bg: #F5F5F5;  /* Açık gri arka plan */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f4f7; /* Hafif gri arka plan */
    color: var(--text-dark);
    margin: 0;
    padding: 0;
}

main {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Saygınlık Kapsayıcı (rep-container) */
.rep-container {
    max-width: 450px;
    width: 100%;
    text-align: left;
}

/* Başlık (rep-header) */
.rep-header {
    margin-bottom: 30px;
    position: relative;
}

.rep-header h1 {
    font-size: 24px;
    font-weight: 900;
    margin: 0;
    text-align: left;
    letter-spacing: 1px;
}

.rep-header .username {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-light);
    margin-top: 5px;
    margin-bottom: 20px;
    text-align:left; 
    text-decoration: underline;
}
/* Saygınlık Değeri (+72) */
.rep-value {
    position: absolute;
    top: 0;
    right: 0;
    width: 80;
    height: 80px;
    border-radius: 50%;
    background-color: #e8f5e9; /* Çok açık yeşil arka plan */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.2);
    transform: translateY(-10px); /* Görseldeki gibi hafif yukarıda */
    transition: background-color 0.3s ease; /* Renk geçişi için */
}

.total-score-value {
    font-size: 28px;
    font-weight: 900;
}
/* POZİTİF (user.totalReputation > 0) */
.rep-value.positive-rep {
    background-color: var(--light-green-bg);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.2);
}

.positive-rep .total-score-value {
    color: var(--primary-green);
}

/* NEGATİF (user.totalReputation < 0) */
.rep-value.negative-rep {
    background-color: var(--light-red-bg);
    box-shadow: 0 0 10px rgba(233, 30, 99, 0.2);
}

.negative-rep .total-score-value {
    color: var(--negative-red);
}

/* NÖTR (user.totalReputation == 0) */
.rep-value.neutral-rep {
    background-color: var(--neutral-gray);
    box-shadow: none; /* Gölgeyi kaldırabiliriz */
}

.neutral-rep .total-score-value {
    color: var(--light-gray-bg);
}

/* Buton (Saygınlık Ekle) */
.add-rep-btn {
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 30px;
    border: none;
    border-radius: 8px;
    background-color: #c8e6c9; /* Açık yeşil buton */
    color: var(--primary-green);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: var(--shadow-light);
}

.add-rep-btn:hover {
    background-color: #a5d6a7;
    transform: translateY(-1px);
}

/* Liste Akışı Kartı (rep-card-flow) */
.rep-card-flow {
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-light);
    padding: 15px 20px;
    overflow: hidden; /* İç elemanların taşmasını engellemek için */
}

/* Liste Elemanı (flow-item) */
.flow-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    position: relative;
    opacity: 0; /* Animasyon için başlangıçta görünmez */
    animation: fadeIn 0.5s ease-out forwards;
}

/* Her öğeye farklı gecikme vererek akış efekti */
.flow-item:nth-child(1) { animation-delay: 0.1s; }
.flow-item:nth-child(2) { animation-delay: 0.2s; }
.flow-item:nth-child(3) { animation-delay: 0.3s; }
/* ... (EJS tarafında n-th child ile daha fazla gecikme eklenebilir) */

/* Kullanıcı Avatarı */
.flow-user {
    flex-shrink: 0;
    margin-right: 15px;
}

.flow-user img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* İçerik ve Başlık */
.flow-content {
    flex-grow: 1;
    text-align: left;
    min-width: 0;
}

.flow-header {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}

.flow-username {
    font-weight: 600;
    font-size: 14px;
    overflow: hidden; 
    text-overflow: ellipsis;
    white-space: nowrap; /* Tek satırda kalmasını sağlar */
    margin-right: 10px; /* İsim ile tarih arasına boşluk koyar */
    display: flex;
    align-items: center;
}

.verified-badge {
    color: #1DA1F2; /* Twitter mavisi */
    font-size: 12px;
    margin-left: 4px;
    font-weight: bold;
}

.flow-date {
    font-size: 12px;
    color: var(--text-light);
    flex-shrink: 0; /* Tarihin sıkışmasını engeller */
}

.flow-message {
    font-size: 13px;
    color: var(--text-dark);
    flex-shrink: 0;
    white-space: normal; /* Metnin normal şekilde sarılmasını sağlar */
    word-wrap: break-word; /* Kelime çok uzunsa kelimeyi bölmeye izin verir */
}

/* Skor (flow-score) */
.flow-score {
    flex-shrink: 0;
    margin-left: 10px;
    font-weight: 900;
    font-size: 15px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: transform 0.2s ease;
    display: flex; /* İçeriği Flexbox yap */
    justify-content: center; /* Yatay ortala */
    align-items: center; /* Dikey ortala */
    /* Metnin kendisi zaten bu elementin içinde olduğu için */
    line-height: 1; /* Satır yüksekliğini sıfırlamak piksel kaymasını azaltır */
}

.flow-score.positive {
    color: var(--primary-green);
    background-color: #e8f5e9; /* Yeşil arka plan */
    transform: translateX(-1px); /* Örn: 1 piksel yukarı kaydır */
    display: inline-block;
}

.flow-score.negative {
    color: var(--negative-red);
    background-color: #ffebee; /* Kırmızı arka plan */
}

/* Ayırıcı Çizgi (flow-divider) */
.flow-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0;
}

/* Daha Fazla Yükle Butonu */
.load-more-btn {
    font-size: 24px;
    font-weight: 900;
    color: var(--text-light);
    cursor: pointer;
    padding: 10px 0;
    transition: color 0.3s ease;
}

.load-more-btn:hover {
    color: var(--primary-green);
}


/* --- ANIMASYONLAR --- */

/* 1. Öğelerin Yavaşça Giriş Animasyonu */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeIn 0.4s ease-out forwards;
}

/* 2. Butonların Nabız Atışı Efekti */
.pulsate-on-hover:hover {
    animation: pulsate 1s infinite;
}

@keyframes pulsate {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

/* 3. Skorların Üzerine Gelindiğinde Hafif Zıplama Efekti */
.bounce-on-hover:hover {
    transform: scale(1.1);
}

/* --- Modal Stilleri --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0, 0, 0, 0.4); 
    padding-top: 60px;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto; /* Ortalamak için */
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%; 
    max-width: 400px; /* Maksimum genişlik */
    position: relative;
    text-align: center;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 700;
}

/* Form Elemanları */
#reputationForm input[type="number"],
#reputationForm textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 15px;
}

#reputationForm textarea {
    resize: vertical;
    min-height: 80px;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-green);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #388e3c;
}

.limit-info {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 15px;
}

/* Giriş Yap/Üye Ol Butonları */
.warning-message {
    font-weight: 600;
    color: var(--negative-red);
}

.auth-buttons {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    margin-top: 20px;
}

.auth-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    transition: background-color 0.3s;
}

.login-btn {
    background-color: #2196F3; /* Mavi */
    color: white;
}

.login-btn:hover {
    background-color: #1976D2;
}

.register-btn {
    background-color: #FF9800; /* Turuncu */
    color: white;
}

.register-btn:hover {
    background-color: #FB8C00;
}

/* Sayaç CSS */
.char-counter-wrapper {
    width: 100%;
    text-align: right;
    margin-top: -10px; /* Textarea'ya yaklaştırmak için */
    margin-bottom: 15px; /* Butondan ayırmak için */
}

#charCount {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.3s ease;
}

/* Sayacın Kırmızı olma durumu zaten JavaScript ile yönetiliyor */
/* Ancak varsayılan olarak da tanımlayabilirsiniz: */
/* #charCount.over-limit { color: var(--negative-red); } */