/* ============================================================
   LISANS SAYFASI — BAĞIMSIZ CSS
   Mutfak (tarifler_style.css) ile birebir uyumlu
   ============================================================ */

/* ============================================================
   1. GENEL / TEMEL
   ============================================================ */
* { 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 ALANI (Sağ)
   ============================================================ */
#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 (Ortak)
   ============================================================ */
.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. LISANS ÖZEL STİLLERİ
   ============================================================ */

/* 8.1 ANA KAPSAYICI */
.lisans-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 8.2 BAŞLIK */
.lisans-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.lisans-header h1 {
    margin: 0;
    font-size: 26px;
    color: #2c3e50;
}

.lisans-header h2 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #2c3e50;
}

/* 8.3 ADMİN ROZETİ */
.lisans-badge {
    display: inline-block;
    background: #8e44ad;
    color: #fff;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 10px;
    margin-left: 10px;
    vertical-align: middle;
    font-weight: 600;
}

/* 8.4 MESAJLAR */
.lisans-msg-success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
}

.lisans-msg-error {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
}

/* 8.5 FLEX DÜZEN */
.lisans-flex {
    display: flex;
    gap: 20px;
    width: 100%;
    align-items: flex-start;
    flex-wrap: wrap;
}

.lisans-box {
    flex: 1;
    min-width: 300px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-sizing: border-box;
}

.lisans-box:first-child {
    flex: 0 0 380px;
    max-width: 380px;
}

.lisans-box-full {
    flex: 1 1 100%;
    width: 100%;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-sizing: border-box;
}

/* 8.6 FORM */
.lisans-form label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    font-size: 14px;
    color: #2c3e50;
}

.lisans-form input[type="text"],
.lisans-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    transition: 0.2s;
}

.lisans-form input[type="text"]:focus,
.lisans-form select:focus {
    outline: none;
    border-color: #8e44ad;
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.15);
}

.lisans-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: url("data:image/svg+xml,%3Csvg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 10px center;
    background-size: 16px;
    padding-right: 35px;
    background-color: #fff;
}

/* 8.7 BUTONLAR (Lisans) */
.lisans-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(#8e44ad, #732d91);
    color: white;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    font-size: 15px;
    font-weight: bold;
    font-family: inherit;
    box-shadow: 0 4px #4a1a5e;
    line-height: 1;
    box-sizing: border-box;
}

.lisans-btn:hover {
    background: linear-gradient(#a056c2, #8e44ad);
    text-decoration: none;
}

.lisans-btn:active {
    box-shadow: 0 2px #4a1a5e;
    transform: translateY(2px);
}

.lisans-btn.full {
    width: 100%;
    margin-top: 15px;
}

.lisans-btn.auto {
    width: auto;
    padding: 12px 30px;
}

.lisans-btn.green {
    background: linear-gradient(#27ae60, #1e8449);
    box-shadow: 0 4px #145a32;
}

.lisans-btn.green:hover {
    background: linear-gradient(#2ecc71, #27ae60);
}

/* 8.8 TABLO */
.lisans-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    table-layout: fixed;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.lisans-table th,
.lisans-table td {
    border: 1px solid #e0e0e0;
    padding: 10px;
    text-align: center;
    word-wrap: break-word;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lisans-table th {
    background: #2c3e50;
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lisans-table tbody tr:nth-child(even) { background: #f9f9f9; }
.lisans-table tbody tr:hover { background: #eaf4ff; }

.lisans-table code {
    background: #ecf0f1;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: #2c3e50;
    font-weight: bold;
}

.lisans-table .col-user    { width: 22%; }
.lisans-table .col-program { width: 24%; }
.lisans-table .col-key     { width: 34%; }
.lisans-table .col-date    { width: 20%; }

/* 8.9 FİLTRE ÇUBUĞU */
.lisans-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.lisans-filter select {
    padding: 8px 30px 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
    background-color: #fff;
    min-width: 160px;
    cursor: pointer;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    transition: 0.2s;
}

.lisans-filter select:focus {
    outline: none;
    border-color: #8e44ad;
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.15);
}

.lisans-clear-btn {
    padding: 8px 14px;
    background: #95a5a6;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}

.lisans-clear-btn:hover { background: #7f8c8d; }

.lisans-count {
    font-size: 13px;
    color: #7f8c8d;
    margin-left: auto;
    font-weight: 600;
}

/* 8.10 BOŞ DURUM */
.lisans-empty {
    color: #7f8c8d;
    text-align: center;
    padding: 30px 15px;
    font-size: 14px;
}

/* ============================================================
   9. 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: 150px !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: 250px !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: 8px !important;
    }

    /* LISANS ÖZEL — MOBİL */
    .lisans-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .lisans-header h1 { font-size: 20px; }
    .lisans-flex { flex-direction: column; gap: 15px; }
    .lisans-box:first-child { flex: 1 1 auto; max-width: 100%; }
    .lisans-box { padding: 15px; }
    .lisans-box-full { padding: 15px; }

    .lisans-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .lisans-table thead,
    .lisans-table tbody {
        display: table;
        width: 80%;
        min-width: 600px;
    }

    .lisans-filter { gap: 6px; }
    .lisans-filter select {
        min-width: 120px;
        font-size: 12px;
        padding: 6px 24px 6px 10px;
    }
    .lisans-clear-btn { padding: 6px 10px; font-size: 12px; }
    .lisans-count {
        font-size: 12px;
        margin-left: 0;
        width: 100%;
        text-align: right;
    }
    .lisans-btn { font-size: 14px; padding: 10px 16px; }
    .lisans-btn.full { font-size: 14px; padding: 12px; }
}