/* Genel Sıfırlamalar ve Temel Stil */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}
#wpadminbar { display: none !important; }
html { margin-top: 0 !important; }

/* Ana Konteyner */
.pm-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Header */
.pm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 60px;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    flex-shrink: 0;
}
.pm-app-title {
    font-size: 1.5em;
    font-weight: 600;
    color: #007bff;
    margin: 0;
}
.pm-add-button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 30px;
    line-height: 44px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.pm-add-button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

/* Ana İçerik ve Tablo */
.pm-main-content {
    flex: 1;
    /* overflow: hidden; -> BU SATIR KALDIRILDI */
    padding: 0;
    display: flex;
}
.pm-table-container {
    flex: 1;
    overflow: auto; /* Hem dikey hem yatay kaydırma burada yönetilir */
    background-color: #fff;
}
.pm-loading-message, #pm-no-arazi-message {
    text-align: center; color: #666; font-size: 1em; padding: 40px 20px;
}
.arazi-data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px; /* Yatay kaydırmayı tetiklemek için minimum genişlik */
}
.arazi-data-table th, .arazi-data-table td {
    padding: 12px 15px;
    border: 1px solid #e9ecef;
    text-align: center;
    font-size: 0.95em;
    white-space: nowrap;
}
.arazi-data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 2;
}
.arazi-data-table tbody tr:hover {
    background-color: #f1f3f5;
}

/* Yapışkan Sütun */
.sticky-col {
    position: sticky;
    left: 0;
    z-index: 1;
    background-color: #f8f9fa; /* Arka planı, altından kayan içeriği gizlemek için gerekli */
    width: 150px;
    text-align: left !important;
}
td.sticky-col {
    font-weight: bold;
    color: #007bff;
    background-color: #fff;
    text-align: left !important;
}
tr:hover td.sticky-col {
    background-color: #f1f3f5;
}

/* Düzenlenebilir Hücreler ve Butonlar */
.editable-cell {
    cursor: pointer;
    min-width: 100px;
}
.editable-cell:hover {
    background-color: #e9f7ff;
}
.arazi-data-table .pm-btn, .arazi-data-table .pm-btn-danger {
    padding: 5px 8px;
    font-size: 0.8em;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    margin: 0 2px;
}
.pm-btn { background-color: #6c757d; color: white; }
.pm-btn:hover { background-color: #5a6268; }
.pm-btn-danger { background-color: #dc3545; color: white; }
.pm-btn-danger:hover { background-color: #c82333; }
.arazi-name-display {
    display: block;
    font-weight: bold;
}

/* Modal */
.pm-modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); }
.pm-modal-content { background-color: #fefefe; margin: 5% auto; padding: 0; border: none; width: 95%; max-width: 550px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.pm-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid #eee; }
.pm-modal-header h2 { margin: 0; font-size: 1.3em; color: #007bff; }
.pm-modal-close { color: #aaa; font-size: 30px; font-weight: bold; cursor: pointer; }
.pm-modal-body { padding: 20px; }

/* Form Stilleri */
.pm-form-group { margin-bottom: 15px; }
.pm-form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9em; }
.pm-form-group input, .pm-form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 1em; }
#imagePreview img { max-width: 100%; max-height: 150px; margin-top: 10px; border-radius: 5px; }
.pm-primary-btn, .pm-secondary-btn { border: none; padding: 12px 20px; border-radius: 5px; cursor: pointer; font-size: 1.1em; width: 100%; }
.pm-primary-btn { background-color: #007bff; color: white; }
.pm-primary-btn:hover { background-color: #0056b3; }
.pm-secondary-btn { background-color: #6c757d; color: white; }
.pm-secondary-btn:hover { background-color: #5a6268; }

/* İlaçlama Modal Özel Stilleri */
#ilac-list-container table { width: 100%; border-collapse: collapse; }
#ilac-list-container th, #ilac-list-container td { padding: 8px; border-bottom: 1px solid #eee; text-align: left; }
#ilac-list-container .view-photo-btn { background: none; border: none; font-size: 1.5em; cursor: pointer; }

/* Bildirim Alanı */
#pmmNotificationArea { position: fixed; top: 10px; right: 10px; z-index: 99999; }
.pm-notification { padding: 12px 18px; border-radius: 5px; color: white; margin-bottom: 5px; box-shadow: 0 2px 8px rgba(0,0,0,0.2); font-size: 0.95em; }
.pm-notification-success { background-color: #28a745; }
.pm-notification-error { background-color: #dc3545; }

/* Mobil & Tablet Uyumluluğu */
@media (max-width: 768px) {
    .pm-header { height: 55px; padding: 0 12px; }
    .pm-app-title { font-size: 1.2em; }
    .pm-add-button {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1001;
        width: 50px;
        height: 50px;
        line-height: 50px;
        font-size: 32px;
    }
    .arazi-data-table { min-width: 0; }
    .arazi-data-table th, .arazi-data-table td { padding: 10px 8px; font-size: 0.85em; }
    .sticky-col { width: 120px; }
    .pm-modal-content { margin: 5% auto; width: 95%; }
    .pm-modal-body { padding: 15px; }
}