/* =========================================
   PENGADUAN MASYARAKAT - STYLE
   ========================================= */

/* ============ ADMIN STYLE ============ */
.pengaduan-admin-wrap h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e293b;
    font-size: 24px;
    margin-bottom: 20px;
}

.pengaduan-admin-wrap h1 .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #2563eb;
}

.pengaduan-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.pengaduan-card h2 {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
    color: #1e293b;
    font-size: 18px;
}

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

.pengaduan-card .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
}

.images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    min-height: 20px;
}

.images-preview .img-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
}

.images-preview .img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.images-preview .img-item .remove-img {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.images-preview .img-item .remove-img:hover {
    background: #dc2626;
}

/* Tabel Admin */
.pengaduan-table {
    border-radius: 8px;
    overflow: hidden;
}

.pengaduan-table thead th {
    background: #1e293b !important;
    color: #fff !important;
    padding: 12px !important;
    font-weight: 600;
}

.pengaduan-table tbody td {
    padding: 12px !important;
    vertical-align: top;
    font-size: 13px;
}

.pengaduan-table .row-unread {
    background: #fef9c3 !important;
}

.pengaduan-table .row-unread:hover {
    background: #fde68a !important;
}

.scroll-text {
    max-height: 120px;
    overflow-y: auto;
    padding-right: 5px;
    font-size: 12px;
    line-height: 1.5;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-new {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.badge-read {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #34d399;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a, .pagination .current {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border-radius: 6px;
    text-decoration: none;
    background: #f1f5f9;
    color: #334155;
}

.pagination .current {
    background: #2563eb;
    color: #fff;
}

.no-data {
    padding: 30px;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
}

/* ============ FRONTEND STYLE ============ */
.pengaduan-frontend {
    max-width: 1000px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pengaduan-header {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    padding: 20px 25px;
    border-radius: 12px 12px 0 0;
}

.pengaduan-header h2 {
    margin: 0;
    color: #fff;
    font-size: 22px;
}

.pengaduan-content {
    background: #fff;
    padding: 25px;
    border: 1px solid #e2e8f0;
    border-top: none;
    line-height: 1.8;
    color: #334155;
    font-size: 15px;
}

.pengaduan-content p {
    margin-bottom: 15px;
}

/* ============ GALERI FULL WIDTH DENGAN PEMBATAS ============ */
.pengaduan-gallery {
    background: #fff;
    padding: 0;
    margin: 0;
    border: 1px solid #e2e8f0;
    border-top: none;
}

.pengaduan-gallery .gallery-item {
    display: block;
    position: relative;
    width: 100%;
    overflow: hidden;
    text-decoration: none;
    line-height: 0;
    border-bottom: 8px solid #f1f5f9;
    background: #f8fafc;
}

.pengaduan-gallery .gallery-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

/* Nomor urut gambar */
.pengaduan-gallery .gallery-item::before {
    content: attr(data-index);
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(37, 99, 235, 0.9);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    line-height: 1;
}

/* Label hover */
.pengaduan-gallery .gallery-item::after {
    content: "🔍 Klik untuk perbesar";
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(15, 23, 42, 0.75);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.pengaduan-gallery .gallery-item:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.pengaduan-gallery .gallery-item img {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    background: #f8fafc;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.pengaduan-gallery .gallery-item:hover img {
    transform: scale(1.03);
    filter: brightness(1.05);
}

/* Pembatas selang-seling warna */
.pengaduan-gallery .gallery-item:nth-child(odd) {
    border-bottom: 8px solid #e0e7ff;
}

.pengaduan-gallery .gallery-item:nth-child(even) {
    border-bottom: 8px solid #dcfce7;
}

/* ============ CTA TOMBOL ============ */
.pengaduan-cta {
    background: #f8fafc;
    padding: 25px;
    text-align: center;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
}

.btn-pengaduan-online {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    border: none;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(22,163,74,0.4);
}

.btn-pengaduan-online:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(22,163,74,0.5);
}

/* ============ MODAL POPUP ============ */
.pengaduan-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 30px 15px;
}

.pengaduan-modal.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.pengaduan-modal-content {
    background: #fff;
    max-width: 700px;
    margin: 20px auto;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    animation: slideUp 0.4s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.pengaduan-modal-header {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.pengaduan-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
}

.pengaduan-modal-close {
    font-size: 30px;
    cursor: pointer;
    line-height: 1;
    color: #fff;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.pengaduan-modal-close:hover {
    background: rgba(255,255,255,0.2);
}

.pengaduan-modal form {
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-col {
    flex: 1;
    min-width: 200px;
}

.form-col.full {
    flex: 100%;
}

.form-col label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #334155;
    font-size: 13px;
}

.form-col .req {
    color: #ef4444;
}

.form-col input,
.form-col select,
.form-col textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.form-col input:focus,
.form-col select:focus,
.form-col textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-col textarea {
    resize: vertical;
    min-height: 60px;
}

.form-col small {
    display: block;
    color: #94a3b8;
    font-size: 11px;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
    margin-top: 10px;
}

.btn-cancel {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-cancel:hover {
    background: #e2e8f0;
    color: #334155;
}

.btn-submit {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    border: none;
    padding: 12px 35px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37,99,235,0.4);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#pengaduan-message .msg-success {
    background: #d1fae5;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #10b981;
    font-size: 14px;
}

#pengaduan-message .msg-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #ef4444;
    font-size: 14px;
}

/* ============ LIGHTBOX ============ */
.pengaduan-lightbox {
    display: none;
    position: fixed;
    z-index: 9999999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    padding: 30px;
    box-sizing: border-box;
}

.pengaduan-lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.pengaduan-lightbox .lightbox-img {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.pengaduan-lightbox .lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 45px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s;
    z-index: 10;
}

.pengaduan-lightbox .lightbox-close:hover {
    transform: rotate(90deg);
    color: #ef4444;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .pengaduan-gallery .gallery-item img {
        max-height: 60vh;
    }
    
    .pengaduan-gallery .gallery-item::before {
        width: 30px;
        height: 30px;
        font-size: 12px;
        top: 10px;
        left: 10px;
    }
    
    .pengaduan-gallery .gallery-item::after {
        font-size: 10px;
        padding: 4px 10px;
        bottom: 10px;
        right: 10px;
    }
    
    .form-col {
        min-width: 100%;
    }
    
    .pengaduan-modal-content {
        margin: 10px auto;
        border-radius: 12px;
    }
    
    .pengaduan-modal form {
        max-height: 75vh;
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .btn-cancel, .btn-submit {
        width: 100%;
    }
    
    .pengaduan-table {
        font-size: 12px;
    }
    
    .pengaduan-lightbox .lightbox-close {
        font-size: 35px;
        top: 10px;
        right: 15px;
    }
}