/* Genel Ayarlar ve Font */
*, *::before, *::after {
    box-sizing: border-box;
}
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fff;
    overflow-x: hidden; /* DÜZELTME: Genel yatay taşmayı engelle */
}

:root {
    --primary-color: #A21CAF;
    --secondary-color: #4a4a4a;
    --button-secondary-color: #b0b0b0;
    --text-dark: #333;
    --text-medium: #777;
    --border-light: #e0e0e0;
}

.profile-container {
    max-width: 1200px;
    margin: 20px auto;
    background-color: #F9FAFB;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* --- ÜST BÖLÜM: Kapak ve Profil --- */
.profile-header {
    position: relative;
    padding-bottom: 70px;
    background-color: #F9FAFB;
}

.cover-image {
    height: 180px;
    overflow: hidden;
}

.houses-bg img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.profile-info-bar {
    position: absolute;
    bottom: 0;
    left: 20px;
    display: flex;
    align-items: flex-end;
    width: calc(100% - 40px);
}

.profile-pic {
    width: 140px;
    height: 140px;
    border-radius: 4px;
    border: 5px solid #fff;
    margin-right: 20px;
    transform: translateY(50px);
    object-fit: cover;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.info-details {
    padding-left: 10px;
    padding-bottom: 1px;
}

.name-status {
    display: flex;
    align-items: center;
}

.name-status h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: bold;
}

.premium-badge {
    margin-left: 10px;
    color: #f7a536;
    font-size: 20px;
}

.location {
    margin: 5px 0 -9px 0;
    color: #777;
    font-size: 14px;
}

.stats span {
    margin-right: 15px;
    color: #999;
    font-size: 14px;
    top:5px;
}

.premium-button {
    position: absolute;
    top: 275px;
    left: 40px;
    background-color: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
}

/* --- DETAYLAR VE BUTONLAR BÖLÜMÜ --- */
.details-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 20px 10px 180px; /* DİKKAT: Masaüstü için soldan boşluk */
    margin-top: 50px;
}

.portfolio-info {
    margin-left: -150px; /* DİKKAT: Masaüstü için sola çekme */
}

.portfolio-info .portfolio-aciklama {
    border: 1px solid #ddd;
    border-radius: 7px;
    background: white;
}

.portfolio-info p {
    margin: 5px 0;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 3px;
    display: inline-block;
}

/* İletişim Butonları (Masaüstü) */
.contact-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
    transition: background-color 0.3s;
}

.phone-button, .message-button2 {
    background-color: #94A3B8;
    color: white;
}
.phone-button:hover, .message-button2:hover {
    background-color: #999;
}

/* --- SEKME NAVİGASYONU --- */
.tab-navigation {
    display: flex;
    justify-content: flex-start;
    border-bottom: 2px solid #ddd;
    margin: 20px 20px 0 20px;
    /* Mobilde kaydırma ayarları */
    overflow-x: auto;
    flex-wrap: nowrap;
}

.tab-button {
    background: transparent; /* Arkaplanı şeffaf yaptık (koyu rengi kaldırdık) */
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600; /* Yazı biraz daha belirgin olsun */
    color: #777; /* Normal durumda AÇIK RENK (Gri) */
    cursor: pointer;
    border-bottom: 3px solid transparent; /* Alt çizgi yer tutucusu */
    transition: all 0.3s ease;
    margin-right: 10px;
    white-space: nowrap;
}

.tab-button.active {
    color: #e91e63; /* Tıklanınca PEMBE (İstek butonuyla aynı) */
    border-bottom-color: #e91e63; /* Alt çizgi de PEMBE */
    background-color: rgba(233, 30, 99, 0.05); /* Çok hafif pembe bir zemin (isteğe bağlı, şık durur) */
}

/* --- SEKME İÇERİKLERİ --- */
.tab-content {
    padding: 20px;
    display: none;
    width: 100%; /* İçeriğin taşmasını önlemek için */
}

.tab-content.active-tab {
    display: block;
}

.about-text {
    background-color: #f7f7f7;
    border-left: 4px solid #A21CAF;
    padding: 15px;
    margin-bottom: 30px;
    font-size: 14px;
    color: #444;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
}

/* --- İLANLAR GRİDİ --- */
.advert-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.advert-card {
    position: relative;
    display: flex;             /* Kartın içindekileri hizala */
    flex-direction: column;    /* Resim üstte, yazı altta olsun */
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;              /* Yükseklik sorunu varsa çözer */
}

.advert-image {
    width: 100%;
    height: 150px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.advert-title {
    margin: 0;
    padding: 0;
    position: relative; /* Yazı olduğu yerde kalsın, uçmasın */
    z-index: 2;         /* Resmin altında kalmasın */
}

/* Linkin kendisi normal dursun, sadece 'hayaleti' kartı kaplasın */
.advert-title a {
    text-decoration: none;
    color: inherit;
    display: block;     /* Satırı kaplasın */
    position: static;   /* ÖNEMLİ: Absolute YAPMAYIN, yoksa yukarı uçar */
    font-size:14px;
}

.advert-title a::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1; /* Favori butonunun (z-index: 5) altında kalsın */
}

.card-body {
    padding: 10px;
    background-color: #fff; /* Arka planı beyaz olsun ki resim altta kalmasın */
    position: relative;
    z-index: 2;
}

.advert-price {
    text-align: center;
    padding: 0 10px 10px 10px;
    margin: 0;
    font-size: 16px;
    color: #000000;
    font-weight: bold;
}

/* --- EKİP GRİDİ --- */
.team-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap; /* Mobilde alt satıra geçmesi için */
}

.team-member-card {
    background: #fff;
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    flex: 1 1 300px; /* Esnek genişlik */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.member-pic {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    object-fit: cover;
    border-radius: 8px;
    border: 5px solid #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.member-info {
    flex-grow: 1;
}

.member-name {
    font-weight: bold;
    margin: 0 0 3px 0;
    font-size: 15px;
}

.member-title {
    margin: 0;
    font-size: 12px;
    color: #777;
}

.member-phone-button {
    background-color: #94A3B8;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}

/* --- AKSİYON BUTONLARI (Masaüstü) --- */
.action-buttons-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: block;
    z-index: 10;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.action-button {
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 150px;
    text-align: center;
    color: white;
}

.request-button { background-color: #e91e63; }
.report-button { background-color: #888; }
.block-button { background-color: #6c757d; }
.request-button:hover, .report-button:hover, .block-button:hover { filter: brightness(0.9); }

.fixed-mobile-actions { display: none; }

/* Favori Butonu */
.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
}
.favorite-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}
.favorite-icon {
    color: #fff;
    font-size: 16px;
}
.favorite-btn.active .favorite-icon { color: #ffc107; }

/* --- RESPONSIVE / MOBİL UYUMLULUK --- */

/* TABLET (1024px altı) */
@media (max-width: 1024px) {
    .advert-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* MOBİL (768px ve altı) */
@media (max-width: 768px) {
    .profile-container {
        margin: 0;
        border-radius: 0;
    }

    /* YENİ EKLENEN: Lokasyon ile İstatistikler arasını açma */
    .location {
        /* Masaüstündeki negatif marjini ( -9px ) iptal edip altına 15px boşluk veriyoruz */
        margin: 5px 0 15px 0;
    }

    /* --- YENİ EKLENEN KISIM --- */
    /* Profil başlığının altındaki fazla boşluğu azalt */
    .profile-header {
        padding-bottom: 10px;
    }
    /* ------------------------- */

    /* DÜZELTME 1: Profil Bilgilerini Ortala */
    .profile-info-bar {
        flex-direction: column;
        align-items: center;
        text-align: center;
        position: relative;
        width: 100%;
        left: 0;
        bottom: auto;
        padding-top: 0;
    }

    .profile-pic {
        width: 120px;
        height: 120px;
        /* GÜNCELLEME: -60px yerine -85px yaparak daha yukarı (kapak resminin içine) ittik */
        margin: -85px auto 10px auto;
        transform: none;
    }

    /* ... (kalan mobil kodları aynen devam eder) ... */
    .info-details {
        padding-left: 0;
        width: 100%;
    }

    .name-status {
        justify-content: center;
    }

    .premium-button {
        display: none; /* Mobilde yer kaplamasın veya yerini değiştirin */
    }

    /* DÜZELTME 2: Detaylar Bölümü Kaymasını Engelle */
    .details-section {
        flex-direction: column;
        align-items: center;
        padding: 0 15px;

        /* --- GÜNCELLENEN KISIM --- */
        /* margin-top: 20px;  <-- ESKİ DEĞER */
        margin-top: 0;      /* <-- YENİ DEĞER: Boşluk tamamen kaldırıldı */
        /* ------------------------- */

        text-align: center;
    }

    /* DÜZELTME 3: Portföy Bilgisindeki Negatif Margini Kaldır */
    .portfolio-info {
        margin-left: 0 !important;
        width: 100%;
        margin-bottom: 20px;
        text-align: center;
    }

    .contact-buttons {
        display: none !important; /* Masaüstü butonları gizle */
    }

    /* DÜZELTME 4: Alt Sabit Menü */
    .action-buttons-container { display: none; } /* Masaüstü butonları gizle */

    .fixed-mobile-actions {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: white;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        padding: 10px 15px;
        z-index: 100;
        gap: 8px;
    }

    .mobile-action-buttons, .mobile-contact-buttons {
        display: flex;
        flex-direction: row;
        gap: 8px;
        width: 100%;
    }

    .action-button, .mobile-contact-buttons button {
        flex: 1;
        padding: 10px 5px;
        font-size: 12px;
        width: auto;
    }

    /* DÜZELTME 5: Tab Menü Ayarları */
    .tab-navigation {
        overflow-x: auto; /* Kaydırmaya izin ver */
        flex-wrap: nowrap;
        margin: 20px 0;
        padding: 0 10px;
        justify-content: space-between; /* Butonları yay */
    }

    .tab-button {
        padding: 10px 8px; /* Paddingi küçült */
        font-size: 13px; /* Yazıyı küçült */
        margin-right: 5px;
        flex: 1 0 auto; /* Esnek ama sıkışmaz */
    }

    /* Tab içeriğindeki taşmaları engelle */
    .tab-content {
        padding: 10px 10px 80px 10px; /* Alttan boşluk (sabit menü için) */
    }

    /* Değerlendirme Kartı Taşması */
    .rating-summary-card {
        width: 100%;
        max-width: 100%;
        margin: 10px 0;
    }

    /* İlan Grid Tablet Ayarı */
    .advert-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* KÜÇÜK MOBİL (576px ve altı) */
@media (max-width: 576px) {
    /* DÜZELTME 6: İlanları mobilde YAN YANA 2'li yap */
    .advert-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* Zorla 2 sütun */
        gap: 8px;
    }

    .advert-image {
        height: 110px; /* Görsel boyunu biraz kıs */
    }

    .advert-title {
        font-size: 12px; /* Başlığı küçült */
        height: 2.8em;
    }

    .advert-price {
        font-size: 14px;
        padding-bottom: 5px;
    }

    /* Takım kartları tam genişlik */
    .team-member-card {
        flex-basis: 100%;
    }
}

/* Modal Stilleri */
.custom-modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}
.custom-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}
.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title { font-size: 1.2rem; font-weight: bold; color:#333; }
.close-modal-btn { font-size: 28px; font-weight: bold; color: #aaa; cursor: pointer; }
.modal-body { padding: 20px; overflow-y: auto; }
.review-item { border-bottom: 1px solid #f0f0f0; padding: 15px 0; }
.review-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.review-stars { color: #f1c40f; font-size: 0.9rem; }
.review-date { color: #999; font-size: 0.8rem; }
.review-type { background: #eef2f5; color: #555; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; margin-bottom: 5px; display: inline-block; }
.review-text { color: #444; line-height: 1.5; font-size: 0.95rem; }

/* Modal Mobil */
@media screen and (max-width: 768px) {
    .custom-modal-content { width: 95%; margin: 15% auto; max-height: 70vh; }
    .close-modal-btn { font-size: 35px; padding: 0 10px; }
}

/* Scrollbar Gizleme (Tablar için) */
.tab-navigation::-webkit-scrollbar { display: none; }
.tab-navigation { -ms-overflow-style: none; scrollbar-width: none; }

/* Değerlendirme Kartı */
.rating-summary-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    max-width: 400px;
    margin: 20px auto;
}
.rating-big-score { font-size: 3rem; font-weight: bold; color: #333; }
.rating-stars { color: #f1c40f; font-size: 1.5rem; margin: 5px 0; }
.rating-count { color: #777; font-size: 0.9rem; }
