/* Pengaduan Styles */

.statistik-desa-pengaduan {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pengaduan-header {
    text-align: center;
    margin-bottom: 30px;
}

.pengaduan-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.pengaduan-header p {
    color: #7f8c8d;
    font-size: 16px;
}

.pengaduan-container {
    display: block;
}

/* Form Section */
.pengaduan-form-section {
    margin-bottom: 40px;
}

#btn-open-modal {
    font-size: 18px;
    padding: 16px 32px;
    min-width: 250px;
    box-shadow: 0 6px 25px rgba(52, 152, 219, 0.4);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #fff;
    margin: 4% auto 6%;
    padding: 0;
    border-radius: 0;
    width: 95%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 28px 32px 24px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 0;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    font-size: 24px;
    font-weight: bold;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: transparent;
}

.modal-close:hover {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
    transform: scale(1.1);
}

.modal-body {
    padding: 36px 32px;
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background-color: #fafbfc;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

/* Turnstile CAPTCHA */
.cf-turnstile {
    display: flex;
    justify-content: center;
    margin: 8px 0;
}

.turnstile-error {
    color: #e74c3c;
    padding: 10px;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    background-color: #fdf2f2;
    text-align: center;
    font-size: 14px;
}

/* Button Styles */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-height: 48px;
    box-sizing: border-box;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 4px 15px rgba(127, 140, 141, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(127, 140, 141, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    margin-top: 32px;
    flex-wrap: wrap;
    padding-top: 24px;
    border-top: 1px solid #ecf0f1;
}

.form-actions .btn {
    width: 100%;
}

/* Pengaduan List */
.pengaduan-list-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.pengaduan-list {
    border: 1px solid #ecf0f1;
    border-radius: 0;
    overflow: hidden;
}

.pengaduan-item {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s;
    background-color: white;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.pengaduan-item:hover {
    background-color: #f8f9fa;
}

.pengaduan-item:last-child {
    border-bottom: none;
}

/* Thread styling untuk reply */
.pengaduan-item.reply {
    margin-left: 50px;
    padding-left: 25px;
    border-left: 2px solid #3498db;
    background-color: #f8fbfc;
    position: relative;
    border-radius: 0 4px 4px 0;
    border-bottom: 1px solid #e1f5fe;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.pengaduan-item.reply:hover {
    background-color: #e8f4fd;
}

.reply-badge {
    background-color: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-right: 8px;
}

.pengaduan-item:last-child {
    border-bottom: none;
}

.pengaduan-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: #7f8c8d;
    flex-wrap: wrap;
}

.pengaduan-nama {
    font-weight: 600;
    color: #3498db;
    font-size: 16px;
}

.pengaduan-subjek {
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.pengaduan-pesan {
    color: #555;
    line-height: 1.6;
    font-size: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.reply-badge {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    margin-right: 8px;
    text-transform: uppercase;
}

.pengaduan-pesan {
    color: #555;
    line-height: 1.5;
    margin-bottom: 10px;
}

.pengaduan-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Status classes - tidak digunakan lagi karena status dihapus */
/* .status-pending, .status-sedang-diprocess, .status-selesai { display: none; } */

.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.error {
    text-align: center;
    padding: 40px;
    color: #e74c3c;
}

.load-more-container {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
}

.load-more-container .btn {
    min-width: 200px;
}

/* ========================================
   RESPONSIVE DESIGN - Mobile First
   ======================================== */

/* Mobile Styles (base) */
@media (max-width: 767px) {
    .statistik-desa-pengaduan {
        padding: 30px 15px 15px;
        margin-top: 10px;
    }

    .pengaduan-header {
        margin-bottom: 20px;
    }

    .pengaduan-header h2 {
        font-size: 24px;
    }

    .pengaduan-header p {
        font-size: 14px;
    }

    .pengaduan-container {
        gap: 20px;
    }

    .pengaduan-form-section {
        margin-bottom: 25px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 50px;
    }

    /* Button Buat Pengaduan */
    #btn-open-modal {
        width: 100%;
        font-size: 16px;
        padding: 14px 20px;
        min-width: auto;
        margin: 0;
        display: flex;
    }

    /* Modal */
    .modal-content {
        width: 100%;
        margin: 0;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-header {
        padding: 20px 16px 16px;
        border-radius: 0;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .modal-body {
        padding: 20px 16px;
        overflow-y: auto;
        flex: 1;
        -webkit-overflow-scrolling: touch;
    }

    /* Form Elements */
    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 14px;
    }

    .form-group textarea {
        min-height: 100px;
    }

    /* Buttons */
    .btn {
        width: 100%;
        padding: 14px 16px;
        font-size: 16px;
        margin-bottom: 8px;
    }

    .pengaduan-list-section {
        margin-top: 35px;
    }

    /* Pengaduan List */
    .pengaduan-list-section h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .pengaduan-list {
        border: none;
        border-radius: 0;
        margin: 0 -15px;
    }

    .pengaduan-item {
        padding: 16px 15px;
        border-bottom: 1px solid #ecf0f1;
        margin: 0 15px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .pengaduan-item:last-child {
        border-bottom: none;
    }

    .pengaduan-meta {
        margin-bottom: 8px;
    }

    .pengaduan-nama {
        font-size: 14px;
    }

    .pengaduan-date {
        font-size: 12px;
    }

    .pengaduan-subjek {
        font-size: 15px;
        margin-bottom: 6px;
        font-weight: 600;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .pengaduan-pesan {
        font-size: 14px;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Thread styling */
    .pengaduan-item.reply {
        margin-left: 60px;
        padding-left: 20px;
        margin-right: 15px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Load more */
    .load-more-container {
        margin-top: 20px;
        padding: 15px 0;
    }

    .load-more-container .btn {
        min-width: auto;
    }
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1023px) {
    .statistik-desa-pengaduan {
        padding: 25px 20px;
        max-width: 900px;
    }

    .pengaduan-header {
        margin-bottom: 30px;
    }

    .pengaduan-header h2 {
        font-size: 28px;
    }

    .pengaduan-container {
        display: block;
        gap: 35px;
    }

    .pengaduan-form-section {
        margin-bottom: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 60px;
    }

    #btn-open-modal {
        width: auto;
        max-width: 320px;
        font-size: 17px;
        padding: 14px 28px;
        display: flex;
        margin: 0;
    }

    .modal-content {
        width: 90%;
        margin: 4% auto 6%;
        max-height: 88vh;
        border-radius: 0;
    }

    .modal-header {
        padding: 28px 28px 24px;
    }

    .modal-header h3 {
        font-size: 20px;
    }

    .modal-body {
        padding: 28px;
    }

    .form-group {
        margin-bottom: 22px;
    }

    .form-group label {
        font-size: 15px;
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px;
        padding: 14px 16px;
    }

    .btn {
        width: auto;
        padding: 15px 24px;
        font-size: 16px;
        max-width: 200px;
        margin: 0 auto;
        display: block;
    }

    .form-actions {
        margin-top: 30px;
        padding-top: 22px;
        gap: 12px;
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }

    .pengaduan-list-section h3 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .pengaduan-list {
        margin: 0;
        border-radius: 0;
    }

    .pengaduan-item {
        padding: 20px;
        margin: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .pengaduan-meta {
        margin-bottom: 10px;
    }

    .pengaduan-nama {
        font-size: 15px;
    }

    .pengaduan-date {
        font-size: 13px;
    }

    .pengaduan-subjek {
        font-size: 16px;
        margin-bottom: 6px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .pengaduan-pesan {
        font-size: 15px;
        line-height: 1.5;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .pengaduan-item.reply {
        margin-left: 50px;
        padding-left: 25px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .load-more-container {
        margin-top: 30px;
        padding: 25px 0;
    }

    .load-more-container .btn {
        min-width: 200px;
        padding: 15px 28px;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .statistik-desa-pengaduan {
        padding: 40px 20px;
        max-width: 1000px;
    }

    .pengaduan-header {
        margin-bottom: 40px;
    }

    .pengaduan-header h2 {
        font-size: 32px;
    }

    .pengaduan-container {
        display: block;
        gap: 50px;
    }

    .pengaduan-form-section {
        margin-bottom: 50px;
        text-align: left;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 80px;
    }

    .pengaduan-list-section {
        margin-top: 30px;
    }

    #btn-open-modal {
        width: auto;
        min-width: 280px;
        font-size: 18px;
        padding: 16px 36px;
        display: flex;
        margin: 0;
    }

    .modal-content {
        width: 95%;
        max-width: 520px;
        margin: 3% auto 5%;
        border-radius: 0;
        max-height: 85vh;
    }

    .modal-header {
        padding: 32px 36px 28px;
    }

    .modal-header h3 {
        font-size: 22px;
    }

    .modal-body {
        padding: 36px;
    }

    .form-group {
        margin-bottom: 28px;
    }

    .form-group label {
        font-size: 15px;
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px;
        padding: 16px 18px;
    }

    .btn {
        width: auto;
        padding: 16px 28px;
        font-size: 16px;
        max-width: 220px;
        margin: 0;
    }

    .form-actions {
        margin-top: 36px;
        padding-top: 28px;
        gap: 16px;
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }

    .pengaduan-list-section h3 {
        font-size: 24px;
        margin-bottom: 25px;
    }

    .pengaduan-list {
        margin: 0;
        border-radius: 0;
    }

    .pengaduan-item {
        padding: 24px;
        margin: 0;
        transition: all 0.2s ease;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .pengaduan-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .pengaduan-meta {
        margin-bottom: 12px;
    }

    .pengaduan-nama {
        font-size: 16px;
        font-weight: 600;
    }

    .pengaduan-date {
        font-size: 14px;
    }

    .pengaduan-subjek {
        font-size: 17px;
        margin-bottom: 8px;
        font-weight: 600;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .pengaduan-pesan {
        font-size: 15px;
        line-height: 1.6;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .pengaduan-item.reply {
        margin-left: 60px;
        padding-left: 30px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .load-more-container {
        margin-top: 40px;
        padding: 30px 0;
    }

    .load-more-container .btn {
        min-width: 220px;
        padding: 16px 32px;
    }
}