/* Admin Panel CSS */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.admin-title {
    color: #C41E3A;
    font-size: 28px;
    font-weight: bold;
}

.back-btn {
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
}

/* Admin Navigation */
.admin-nav {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-button {
    padding: 12px 24px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-button:hover {
    border-color: #C41E3A;
    color: #C41E3A;
}

.nav-button.active {
    background: #C41E3A;
    border-color: #C41E3A;
    color: white;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #C41E3A;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.main-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.section-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.add-btn {
    background: #C41E3A;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

/* ========== KULLANICI TABLOSU ========== */
.users-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.users-table th,
.users-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.users-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

/* Kullanıcı Tablosu Kolon Genişlikleri */
.users-table th:nth-child(1), .users-table td:nth-child(1) { width: 20%; } /* Adı Soyadı */
.users-table th:nth-child(2), .users-table td:nth-child(2) { width: 12%; } /* BM */
.users-table th:nth-child(3), .users-table td:nth-child(3) { width: 12%; } /* Telefon */
.users-table th:nth-child(4), .users-table td:nth-child(4) { width: 10%; } /* Rol */
.users-table th:nth-child(5), .users-table td:nth-child(5) { width: 8%; }  /* Durum */
.users-table th:nth-child(6), .users-table td:nth-child(6) { width: 13%; } /* Son Giriş */
.users-table th:nth-child(7), .users-table td:nth-child(7) { width: 8%; }  /* İlan Sayısı */
.users-table th:nth-child(8), .users-table td:nth-child(8) { width: 12%; } /* İşlemler */

.users-table tr:hover {
    background: #f8f9fa;
}

.users-table tr.superadmin-row {
    background: linear-gradient(135deg, #fff9e6, #fff3cd);
    border-left: 4px solid #ffc107;
}

.users-table tr.superadmin-row:hover {
    background: linear-gradient(135deg, #fff3cd, #ffecb3);
}

/* ========== İLAN TABLOSU ========== */
.listings-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.listings-table th,
.listings-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listings-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

/* İlan Başlığı kolonu için özel stil - wrap etsin */
.listings-table th:nth-child(3), .listings-table td:nth-child(3) {
    overflow: visible;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
}

/* İlan Tablosu Kolon Genişlikleri */
.listings-table th:nth-child(1), .listings-table td:nth-child(1) { width: 8%; }  /* Yayın Tipi */
.listings-table th:nth-child(2), .listings-table td:nth-child(2) { width: 13%; } /* Portföy Cinsi */
.listings-table th:nth-child(3), .listings-table td:nth-child(3) { width: 20%; } /* İlan Başlığı */
.listings-table th:nth-child(4), .listings-table td:nth-child(4) { width: 12%; } /* Fiyat */
.listings-table th:nth-child(5), .listings-table td:nth-child(5) { width: 8%; }  /* İl */
.listings-table th:nth-child(6), .listings-table td:nth-child(6) { width: 15%; } /* İlan Sahibi */
.listings-table th:nth-child(7), .listings-table td:nth-child(7) { width: 10%; } /* BM */
.listings-table th:nth-child(8), .listings-table td:nth-child(8) { width: 10%; } /* İşlemler */

.listings-table tr:hover {
    background: #f8f9fa;
}

/* ========== ORTAK TABLO STİLLERİ ========== */
/* Genel data-table sınıfı (eski kodlarda kullanılmaya devam etmesi için) */
.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Badges */
.role-badge, .status-badge, .type-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.role-admin {
    background: #ff4757;
    color: white;
}

.role-user {
    background: #2ed573;
    color: white;
}

.role-superadmin {
    background: linear-gradient(135deg, #ffc107, #ff8c00);
    color: #fff;
    border: 2px solid #ff8c00;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.status-active {
    background: #2ed573;
    color: white;
}

.status-inactive {
    background: #747d8c;
    color: white;
}

.type-badge {
    background: #4A90E2;
    color: white;
}

/* Yayın Tipi Renkleri */
.type-badge.sale {
    background: #dc3545; /* Kırmızı - Satılık */
    color: white;
}

.type-badge.rent {
    background: #fd7e14; /* Turuncu - Kiralık */
    color: white;
}

.type-badge.project {
    background: #6f42c1; /* Mor - Proje */
    color: white;
}

.protected-user {
    color: #ffc107;
    font-weight: bold;
    font-size: 12px;
    padding: 5px 10px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 4px;
    border: 1px solid #ffc107;
}

/* Action Buttons */
.action-btns {
    display: flex;
    gap: 5px;
}

.edit-btn, .view-btn, .delete-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
}

.edit-btn {
    background: #4A90E2;
    color: white;
}

.view-btn {
    background: #2ed573;
    color: white;
}

.delete-btn {
    background: #ff4757;
    color: white;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #C41E3A;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
}

.close:hover {
    color: #000;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #C41E3A;
    outline: none;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.cancel-btn {
    background: #747d8c;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.save-btn {
    background: #C41E3A;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Messages */
.error-message {
    background: #ff4757;
    color: white;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
}

.success-message {
    background: #2ed573;
    color: white;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
}

/* Truncated Text */
.truncated-title {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.truncated-title:hover::after {
    content: attr(title);
    position: absolute;
    top: -30px;
    left: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Price formatting */
.price-text {
    font-weight: bold;
    color: #C41E3A;
}

/* Filter Controls */
.filter-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    margin-bottom: 8px;
    min-height: 32px;
}

.filter-select:focus {
    border-color: #C41E3A;
    outline: none;
    box-shadow: 0 0 0 2px rgba(196, 30, 58, 0.1);
}

.filter-select[multiple] {
    height: auto;
    min-height: 60px;
}

.clear-filter {
    font-size: 11px;
    color: #666;
    text-decoration: none;
    display: block;
    text-align: center;
    margin-top: 5px;
}

.clear-filter:hover {
    color: #C41E3A;
    text-decoration: underline;
}

/* Usage Purpose Filter Styles */
.usage-purpose-checkboxes-filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 6px;
    margin-top: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    max-height: 170px;
    overflow-y: auto;
}

.checkbox-item-filter {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.checkbox-item-filter:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-1px);
}

.checkbox-item-filter input[type="checkbox"] {
    margin: 0;
    margin-right: 6px;
    width: 14px;
    height: 14px;
    accent-color: #C41E3A;
    cursor: pointer;
}

.checkbox-item-filter input[type="checkbox"]:checked + .checkmark-text {
    font-weight: 600;
    color: #C41E3A;
}

.checkbox-item-filter:has(input:checked) {
    background: #fff5f5;
    border-color: #C41E3A;
    box-shadow: 0 2px 4px rgba(196, 30, 58, 0.15);
}

.checkbox-item-filter .checkmark-text {
    flex: 1;
    user-select: none;
    transition: all 0.2s ease;
    font-size: 12px;
}

/* Animation for checkbox selection */
@keyframes checkboxSelect {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.checkbox-item-filter:has(input:checked) {
    animation: checkboxSelect 0.3s ease;
}

/* Usage Controls */
.usage-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.usage-control-link {
    font-size: 11px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.usage-control-link:hover {
    color: #C41E3A;
    text-decoration: underline;
}

.usage-control-separator {
    color: #ccc;
    font-size: 11px;
    user-select: none;
}

/* İlan Başlığı Özel Stilendirme */
.listing-title-cell {
    font-size: 13px !important;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.listing-title-cell:hover {
    max-height: none;
    overflow: visible;
    background: #f8f9fa;
    position: relative;
    z-index: 10;
    border-radius: 4px;
    padding: 8px;
    margin: -8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Portföy Cinsi Özel Stilendirme */
.portfolio-type-cell {
    font-size: 13px !important;
}

.portfolio-type-cell strong {
    font-size: 13px !important;
    font-weight: 600;
}

.portfolio-type-cell div:first-child {
    font-size: 13px !important;
}

.portfolio-type-cell div:last-child {
    font-size: 11px !important;
    color: #666 !important;
    margin-top: 2px;
}
/* Admin Navigation Styles */
.admin-nav {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-button {
    flex: 1;
    padding: 15px 20px;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #666;
    background: white;
    border: none;
    border-right: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-button:last-child {
    border-right: none;
}

.nav-button:hover {
    background: #f8f9fa;
    color: #C41E3A;
}

.nav-button.active {
    background: #C41E3A;
    color: white;
}

.nav-button.active:hover {
    background: #a51729;
}

/* Responsive admin navigation */
@media (max-width: 768px) {
    .admin-nav {
        flex-direction: column;
        gap: 1px;
    }
    
    .nav-button {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .nav-button:last-child {
        border-bottom: none;
    }
}