/* ============================================================
   MUTFAK TARİFLERİ — TAM BAĞIMSIZ CSS
   ============================================================ */

/* 1. GENEL */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f4f6f8;
}

a { color: #3498db; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 2. TOPBAR */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #34495e;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1003;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    box-sizing: border-box;
}

.topbar .logo {
    font-weight: bold;
    font-size: 16px;
    color: white;
}

.topbar .auth-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 14px;
    flex-wrap: wrap;
}

/* 3. SIDEBAR */
.sidebar {
    width: 230px;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 25px;
    background: #2c3e50;
    color: white;
    overflow-y: auto;
    padding-top: 0;
    z-index: 1001;
    box-sizing: border-box;
}

.sidebar::-webkit-scrollbar { width: 0; display: none; }

.sidebar-logo { width: 100%; text-align: center; margin: 0; padding: 0; }
.sidebar-logo img { max-width: 230px; width: 100%; height: auto; display: inline-block; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }

.sidebar a {
    display: block;
    padding: 10px 15px;
    margin: 5px 0;
    text-decoration: none;
    color: white;
    background: #34495e;
    border-radius: 5px;
    box-shadow: 0 2px 0 #2c3e50;
    transition: all 0.2s;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.sidebar a:hover {
    background: linear-gradient(#1abc9c, #16a085);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #117a65;
    text-decoration: none;
}

.sidebar a:active { transform: translateY(2px); box-shadow: 0 2px 0 #1a252f; }
.sidebar a.active {
    background: linear-gradient(#3498db, #2980b9);
    box-shadow: 0 4px 0 #1f4e6e;
    font-weight: bold;
}

/* 4. REKLAM */
#ad-area, .right-ad {
    width: 250px;
    position: fixed;
    top: 60px;
    right: 0;
    bottom: 25px;
    background: #cfe5f0;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 998;
    box-sizing: border-box;
}

#ad-area .ad-slot, .right-ad .ad-slot { display: flex; justify-content: center; }
#ad-area .ad-slot img, .right-ad .ad-slot img { max-width: 100%; height: auto; display: block; }

.inactive-slot {
    background: #e6f0f8;
    color: #888;
    text-align: center;
    padding: 40px 10px;
    border-radius: 6px;
    font-size: 14px;
}

/* 5. FOOTER */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 25px;
    line-height: 0;
    background: #34495e;
    color: white;
    text-align: center;
    padding: 0 20px;
    font-size: 14px;
    z-index: 1002;
    box-sizing: border-box;
}

footer p { margin: 0; line-height: 25px; }

/* 6. SAYFA YAPISI */
.page-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-top: 60px;
    padding: 0;
    min-height: calc(100vh - 85px);
}

.main-wrapper {
    display: block;
    margin-left: 230px;
    margin-right: 250px;
    padding: 20px;
    min-height: calc(100vh - 85px);
    width: auto;
    min-width: 0;
    box-sizing: border-box;
    flex: 1;
}

/* 7. BUTONLAR */
.btn {
    display: inline-block;
    padding: 10px 15px;
    margin-top: 10px;
    text-decoration: none;
    border-radius: 5px;
    background: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn:hover { background: #2980b9; text-decoration: none; }

.auth-buttons .btn {
    margin-left: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: 0 3px 0 #1a252f;
    transition: all 0.2s ease;
    color: white;
    display: inline-block;
}

.auth-buttons .btn:hover { transform: translateY(-2px); text-decoration: none; }
.auth-buttons .login { background: #3498db; color: white; }
.auth-buttons .signup { background: #2ecc71; color: white; }
.auth-buttons .admin-panel { background: #e67e22; color: white; }

.system_button {
    background: linear-gradient(#4A90E2, #357ABD);
    border: 1px solid #2c5fa4;
    color: #fff;
    font-weight: bold;
    border-radius: 6px;
    padding: 8px 16px;
    margin: 5px 0 5px 5px;
    cursor: pointer;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    box-shadow: 0 4px #2c5fa4;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1;
    text-decoration: none;
    font-family: inherit;
    font-size: 14px;
}

.system_button:hover {
    background: linear-gradient(#5AA0F2, #3d6fbf);
    text-decoration: none;
}

/* 8. MUTFAK */
.tarif-container { width: 100%; }
.tarif-header { margin-bottom: 20px; }
.tarif-header h1 { margin: 0; font-size: 26px; color: #2c3e50; }

.tarif-search { margin-bottom: 20px; }
.tarif-search input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    transition: 0.2s;
}

.tarif-search input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
}

/* 9. KATEGORİ MENÜSÜ */
.kategori-menu {
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kategori-menu button {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
}

.kategori-menu button:hover { background: #e0e0e0; transform: translateY(-1px); }

.kategori-menu button.active {
    background: linear-gradient(145deg, #27ae60, #2ecc71);
    color: white;
    border-color: #27ae60;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3);
}

/* 10. TARİF GRID */
.tarif-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    grid-auto-rows: 100px;    /* ⬅️ HER SATIR 100px SABİT */
}

.tarif-kart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 18px 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    min-height: 90px;
}

.tarif-kart:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.tarif-adi {
    font-weight: bold;
    font-size: 15px;
    color: #2c3e50;
    line-height: 1.3;
    margin-bottom: 5px;
}

.begeni-sayisi { font-size: 13px; color: #777; }

.kategori-section h2 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.4em;
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
}

.kategori-section:first-child h2 { margin-top: 0; }

/* 11. MODAL */
.tarif-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
}

.tarif-modal .modal-content {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    background: #fff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    user-select: none;
    -webkit-user-select: none;
}

.tarif-modal .modal-header {
    padding: 10px 15px;
    background: #222;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tarif-modal .modal-header span { font-weight: bold; font-size: 16px; }
.tarif-modal .modal-header button {
    border: none;
    color: #fff;
    padding: 6px 14px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
}

.tarif-modal iframe { flex: 1; width: 100%; border: none; }

/* 12. BEĞENİ */
#likeBtn:hover {
    background: rgba(255,255,255,0.15) !important;
    transform: scale(1.05);
}
#likeBtn:disabled { cursor: default; transform: none; }

/* 13. YAZDIRMA */
@media print {
    body * { visibility: hidden; }
    .tarif-modal .modal-content::before {
        content: "⚠️ Bu içerik yazdırılamaz. © Alper Lalbek";
        visibility: visible;
        display: block;
        font-size: 24px;
        color: #e74c3c;
        text-align: center;
        padding: 50px;
    }
}

/* ============================================================
   14. RESPONSIVE — MOBİL VE TABLET (900px altı)
   ============================================================ */
@media (max-width: 900px) {

    /* TOPBAR */
    .topbar { padding: 0 8px; height: 55px; }
    .topbar .logo {
        font-size: 13px;
        max-width: 40%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .topbar .auth-buttons { gap: 3px; flex-wrap: nowrap; }
    .topbar .auth-buttons .btn {
        padding: 6px 8px;
        font-size: 14px;
        border-radius: 50%;
        width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        overflow: hidden;
        white-space: nowrap;
        margin-left: 0;
    }
    .topbar .auth-buttons .btn span,
    .topbar .auth-buttons .btn .btn-text { display: none !important; }

    /* SIDEBAR — Küçült (50px) */
    .sidebar { width: 50px !important; overflow: hidden !important; }
    .sidebar-logo { display: none !important; }
    .sidebar a {
        padding: 10px 4px !important;
        font-size: 10px !important;
        text-align: center !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        text-overflow: clip !important;
    }

    /* REKLAM — Küçült (50px) */
    #ad-area, .right-ad { width: 50px !important; padding: 4px !important; }
    #ad-area .ad-slot img, .right-ad .ad-slot img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* İÇERİK */
    .main-wrapper {
        margin-left: 50px !important;
        margin-right: 50px !important;
        padding: 5px !important;
    }

    /* Sabit genişlik */
    .tarif-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 75px) !important;   /* ← Sabit 75px */
        gap: 6px !important;
        justify-content: center !important;                   /* ← Ortala */
    }

    .tarif-kart {
        width: 75px !important;
        height: 75px !important;                              /* ← Sabit */
        min-height: 75px !important;
        padding: 6px 3px !important;
        overflow: hidden !important;
    }

    .tarif-adi {
        font-size: 10px !important;
        line-height: 1.1 !important;
        word-break: break-word !important;
        overflow: hidden !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
    }

    .begeni-sayisi {
        font-size: 9px !important;
    }

    /* BAŞLIK VE ARAMA */
    .tarif-header h1 { font-size: 20px !important; }
    .tarif-search input {
        padding: 8px 10px !important;
        font-size: 13px !important;
        margin-bottom: 10px !important;
    }

    /* KATEGORİ MENÜSÜ — 3 sütun grid */
    .kategori-menu {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 4px !important;
        margin-bottom: 15px !important;
    }
    .kategori-menu button {
        padding: 8px 6px !important;
        font-size: 12px !important;
        white-space: normal !important;
        word-break: break-word !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        line-height: 1.2 !important;
    }

    /* KATEGORİ BAŞLIKLARI */
    .kategori-section h2 {
        font-size: 1.1em !important;
        margin: 15px 0 8px 0 !important;
    }

    /* MODAL — Tam ekran */
    .tarif-modal .modal-content {
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
    }
}