/* Modern Reset and CSS Variables */
:root {
    --bg-color: #f7f9fc;
    --text-main: #2d3748;
    --text-muted: #718096;
    --card-bg: #ffffff;
    --nav-bg: #ffffff;
    --link-color: #4a5568;
    --link-active: #3182ce;
    --header-bg: #2b6cb0;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Container */
.site-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header Section --- */
.site-header {
    background-color: var(--nav-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    overflow: hidden;
}

.banner {
    background: linear-gradient(135deg, var(--header-bg), #4299e1);
    color: white;
    padding: 60px 24px;
    text-align: center;
}

.banner h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.banner p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* --- Navigation --- */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.menu {
    list-style: none;
    display: flex;
    gap: 30px;
}

.menu a {
    text-decoration: none;
    color: var(--link-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu a:hover {
    color: var(--link-active);
}

.search-bar {
    display: flex;
    gap: 8px;
}

.search-bar input {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #f8fafc;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
    width: 200px;
}

.search-bar input:focus {
    border-color: var(--link-active);
    background: white;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.search-bar button {
    padding: 10px 20px;
    background: var(--link-active);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.search-bar button:hover {
    background: #2b6cb0;
}

/* --- Content Wrapper (Grid Layout) --- */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 340px; /* İçerik ve Reklam alanı genişliği */
    gap: 30px;
    flex: 1;
}

/* --- Main Content (Target Area) --- */
.main-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-sm);
    min-height: 500px;
    transition: opacity 0.3s ease;
}

.main-content.loading {
    opacity: 0.4;
    pointer-events: none;
}

.main-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text-main);
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 10px;
}

.main-content p {
    color: #4a5568;
    margin-bottom: 16px;
    font-size: 1.05rem;
}

/* --- AdSense Sidebar --- */
.adsense-sidebar {
    background: transparent;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Sticky sidebar özelliği: Kullanıcı aşağı kaydırsa bile reklam ekranda kalır (AdSense için harikadır) */
    position: sticky;
    top: 24px;
    align-self: start;
}

.ad-placeholder {
    width: 300px;
    min-height: 600px;
    background: #edf2f7;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Footer --- */
.site-footer {
    background: var(--card-bg);
    padding: 30px;
    text-align: center;
    border-radius: var(--radius-lg);
    margin-top: 40px;
    box-shadow: var(--shadow-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========================================================
   RESPONSIVE DESIGN (Media Queries for Tablet & Mobile)
   ======================================================== */

/* Tablet & Küçük Ekranlar (992px altı) */
@media (max-width: 992px) {
    .content-wrapper {
        /* Sidebar'ı içeriğin altına atar */
        grid-template-columns: 1fr; 
    }
    
    .adsense-sidebar {
        position: static;
        width: 100%;
        margin-top: 20px;
    }

    .ad-placeholder {
        width: 100%;
        max-width: 728px; /* Tablet leaderboard boyutu */
        min-height: 90px;
    }
}

/* Mobil Ekranlar (768px altı) */
@media (max-width: 768px) {
    .site-wrapper {
        padding: 12px;
    }

    .banner {
        padding: 40px 15px;
    }

    .banner h1 {
        font-size: 1.8rem;
    }

    .main-nav {
        flex-direction: column;
        padding: 20px;
    }
    
    .menu {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .search-bar input {
        flex: 1;
        width: auto;
    }
    
    .main-content {
        padding: 25px 20px;
    }

    .ad-placeholder {
        max-width: 320px; /* Mobil uyumlu reklam boyutu */
        min-height: 250px;
    }
}

/* ========================================================
   CAFE MANAGEMENT SYSTEM STYLES
   ======================================================== */
.cafe-container {
    padding: 10px;
}

.cafe-container h2 {
    color: #2b6cb0;
    margin-bottom: 25px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.card {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}
.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #4a5568;
    font-size: 0.9em;
}

input[type="text"],
input[type="number"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: #f8fafc;
}

input:focus, textarea:focus, select:focus {
    border-color: #3182ce;
    outline: none;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
    background: white;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.primary-btn {
    background-color: #3182ce;
    color: white;
}
.primary-btn:hover { background-color: #2b6cb0; }

.success-btn {
    background-color: #48bb78;
    color: white;
}
.success-btn:hover { background-color: #38a169; }

.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}
.alert.success { background-color: #c6f6d5; color: #22543d; border: 1px solid #9ae6b4; }
.alert.error { background-color: #fed7d7; color: #822727; border: 1px solid #feb2b2; }

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.cafe-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.cafe-table th, .cafe-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.cafe-table th {
    background-color: #f7fafc;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
}

.cafe-table tr:hover {
    background-color: #f8fafc;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    border-left: 5px solid #3182ce;
}

.stat-title {
    font-size: 0.9em;
    color: #718096;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #2d3748;
}

.text-danger { color: #e53e3e; }
.text-success { color: #38a169; }

/* Utilities */
.mt-20 { margin-top: 20px; }
.text-center { text-align: center; }

/* ========================================================
   GÖNDERİ LISTELEME (GEZGİNLER TARZI KARTLAR)
   ======================================================== */
.post-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    gap: 20px;
    transition: 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.post-card:hover {
    border-color: var(--link-active);
    box-shadow: var(--shadow-md);
}

.post-img {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    background: #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    color: var(--header-bg);
}

.post-content p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    flex: 1;
    /* Metni 3 satırda (Kısaltarak) tutar */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

.post-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.post-btn {
    background: var(--link-active);
    color: white;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.2s;
}

.post-btn:hover {
    background: #2b6cb0;
}

/* SAYFALAMA (1 2 3) */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}
.pagination a, .pagination span {
    padding: 8px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: 0.2s;
    font-weight: 500;
}
.pagination a:hover {
    background: #edf2f7;
    border-color: var(--link-active);
    color: var(--link-active);
}
.pagination .active {
    background: var(--link-active);
    border-color: var(--link-active);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Mobil Uyum Gönderi Kartı */
@media (max-width: 600px) {
    .post-card {
        flex-direction: column;
        gap: 15px;
    }
    .post-img {
        width: 100%;
        height: 180px;
    }
}

/* ========================================================
   POPUP YAPI STİLLERİ
   ======================================================== */
.site-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.site-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.site-popup-box {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
    transform: translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.site-popup-overlay.show .site-popup-box {
    transform: translateY(0);
}

.site-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ef4444;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    border: none;
    transition: background 0.2s;
    z-index: 10;
}

.site-popup-close:hover {
    background: #b91c1c;
}

.site-popup-content-area {
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.6;
}

.site-popup-content-area img,
.site-popup-content-area video,
.site-popup-content-area iframe {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin-top: 10px;
    margin-bottom: 10px;
}
