* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
}

/* ============ VIEW CONTAINERS ============ */

.view-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============ PUBLIC VIEW ============ */

.public-header {
    background: linear-gradient(135deg, #ff9933 0%, #138808 50%, #000080 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.emblem {
    font-size: 48px;
}

.header-text h1 {
    font-size: 20px;
    margin-bottom: 4px;
}

.header-text p {
    font-size: 13px;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.language-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.language-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.admin-link-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-link-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.public-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background: #f8f9fa;
}

.complaint-form-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
}

.complaint-form-container h2 {
    color: #138808;
    margin-bottom: 10px;
    font-size: 24px;
}

.form-description {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

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

.form-group textarea {
    resize: vertical;
}

.upload-box {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8f9fa;
}

.upload-box:hover {
    border-color: #138808;
    background: #f0f8f0;
}

.upload-box.dragover {
    border-color: #138808;
    background: #e8f5e8;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-box p {
    margin: 8px 0;
    color: #333;
}

.upload-hint {
    font-size: 12px;
    color: #999;
}

.image-preview-box {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.image-preview-box img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-submit-complaint {
    width: 100%;
    padding: 14px;
    background: #138808;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit-complaint:hover {
    background: #0f6b06;
}

/* ============ ADMIN LOGIN VIEW ============ */

.login-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .emblem {
    font-size: 60px;
    margin-bottom: 15px;
}

.login-header h2 {
    color: #333;
    margin-bottom: 5px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-hint {
    background: #e3f2fd;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    color: #1976d2;
    margin-bottom: 20px;
    line-height: 1.5;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #138808;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 10px;
}

.btn-login:hover {
    background: #0f6b06;
}

.btn-back {
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back:hover {
    background: #e9ecef;
}

/* ============ ADMIN DASHBOARD VIEW ============ */

.admin-header {
    background: linear-gradient(135deg, #ff9933 0%, #138808 50%, #000080 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-user {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.admin-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #f8f9fa;
}

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

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

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

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

.complaints-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.complaints-section h2 {
    font-size: 18px;
    margin: 0;
    color: #333;
}

.btn-export {
    background: #198754;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-export:hover {
    background: #157347;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.complaints-table {
    width: 100%;
}

.table-header {
    display: grid;
    grid-template-columns: 80px 1fr 1.5fr 120px 120px 150px 180px;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.table-body {
    min-height: 200px;
}

.no-complaints {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14px;
}

.complaint-row {
    display: grid;
    grid-template-columns: 80px 1fr 1.5fr 120px 120px 150px 180px;
    gap: 10px;
    padding: 15px 12px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.complaint-row:hover {
    background: #f8f9fa;
}

.complaint-id {
    font-weight: 600;
    color: #138808;
}

.complaint-location,
.complaint-description,
.complaint-contact {
    font-size: 13px;
    color: #333;
}

.complaint-description {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-processing {
    background: #cfe2ff;
    color: #084298;
}

.status-completed {
    background: #d1e7dd;
    color: #0a3622;
}

.assigned-officer {
    font-size: 13px;
    color: #333;
}

.complaint-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-view {
    background: #6c757d;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-view:hover {
    background: #5a6268;
}

.btn-assign, .btn-complete {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-assign {
    background: #0d6efd;
    color: white;
}

.btn-assign:hover {
    background: #0b5ed7;
}

.btn-complete {
    background: #198754;
    color: white;
}

.btn-complete:hover {
    background: #157347;
}

.completed-icon {
    color: #198754;
    font-size: 20px;
}

.btn-delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 4px;
}

.btn-delete:hover {
    background: #bb2d3b;
}

.complaint-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

/* ============ MODALS ============ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

.modal-content.large-modal {
    max-width: 700px;
}

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

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

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-body > p {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.5;
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8f9fa;
}

.upload-area:hover {
    border-color: #138808;
    background: #f0f8f0;
}

.upload-area.dragover {
    border-color: #138808;
    background: #e8f5e8;
}

.upload-area p {
    margin: 8px 0;
    color: #333;
}

.image-preview {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-change-image {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-change-image:hover {
    background: #5a6268;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-cancel {
    padding: 10px 20px;
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #e9ecef;
}

.btn-submit {
    padding: 10px 20px;
    background: #198754;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: #157347;
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-delete-confirm {
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-delete-confirm:hover {
    background: #bb2d3b;
}

.warning-message {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffecb5;
    border-radius: 8px;
    margin-bottom: 10px;
}

.warning-message p {
    margin: 8px 0;
    color: #664d03;
    line-height: 1.5;
}

.warning-message strong {
    color: #cc0000;
}

.delete-info {
    margin-top: 16px;
    padding: 16px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.delete-info p {
    margin: 8px 0;
    color: #333;
    font-size: 14px;
}

.officer-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* Success Modal */
.success-modal-content {
    text-align: center;
    padding: 40px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #198754;
    color: white;
    font-size: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-modal-content h2 {
    color: #138808;
    margin-bottom: 15px;
}

.success-modal-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.btn-ok {
    padding: 12px 40px;
    background: #138808;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.2s;
}

.btn-ok:hover {
    background: #0f6b06;
}

/* View Details Modal */
.complaint-details {
    font-size: 14px;
}

.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-label {
    font-weight: 600;
    color: #666;
    min-width: 140px;
}

.detail-value {
    flex: 1;
    color: #333;
}

.complaint-id-value {
    color: #138808;
    font-weight: 600;
}

.detail-section {
    margin-top: 20px;
}

.detail-section h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 15px;
}

.detail-description {
    color: #666;
    line-height: 1.6;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.detail-image {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============ NOTIFICATIONS ============ */

.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #198754;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease-out;
}

.notification-toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* ============ RESPONSIVE DESIGN ============ */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .public-header,
    .admin-header {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .emblem {
        font-size: 36px;
    }

    .header-text h1 {
        font-size: 18px;
    }

    .header-text p {
        font-size: 12px;
    }

    .complaint-form-container {
        padding: 30px 20px;
    }

    .admin-content {
        padding: 20px 15px;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-number {
        font-size: 24px;
    }

    .complaints-section {
        padding: 15px;
    }

    .table-header {
        grid-template-columns: 70px 1fr 1fr 110px 140px;
        font-size: 12px;
        gap: 8px;
    }

    .complaint-row {
        grid-template-columns: 70px 1fr 1fr 110px 140px;
        font-size: 12px;
        gap: 8px;
        padding: 10px;
    }

    .col-description,
    .complaint-description,
    .col-contact,
    .complaint-contact {
        display: none;
    }

    .login-box {
        padding: 30px 20px;
    }

    .modal-content {
        width: 95%;
    }

    .notification-toast {
        right: 10px;
        left: 10px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .public-header,
    .admin-header {
        padding: 12px 15px;
    }

    .emblem {
        font-size: 28px;
    }

    .header-text h1 {
        font-size: 16px;
    }

    .header-text p {
        font-size: 11px;
    }

    .language-toggle-btn,
    .admin-link-btn,
    .btn-logout {
        padding: 6px 12px;
        font-size: 12px;
    }

    .header-actions {
        gap: 6px;
    }

    .complaint-form-container {
        padding: 20px 16px;
    }

    .complaint-form-container h2 {
        font-size: 20px;
    }

    .form-description {
        font-size: 14px;
    }

    .admin-content {
        padding: 15px 10px;
    }

    .admin-stats {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    .stat-number {
        font-size: 28px;
        margin-bottom: 0;
    }

    .complaints-section {
        padding: 12px;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 15px;
    }

    .complaints-section h2 {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .btn-export {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 15px;
    }

    /* Mobile-optimized table - card layout */
    .table-header {
        display: none;
    }

    .complaint-row {
        display: block;
        padding: 12px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 12px;
        background: white;
    }

    .complaint-row:hover {
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .complaint-row > div {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
        align-items: center;
    }

    .complaint-row > div:not(:last-child) {
        border-bottom: 1px solid #f0f0f0;
    }

    .complaint-row > div::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        font-size: 12px;
        margin-right: 10px;
    }

    .complaint-id {
        font-size: 14px;
    }

    .complaint-location,
    .complaint-description,
    .complaint-contact,
    .assigned-officer {
        font-size: 12px;
        display: block !important;
    }

    .status-badge {
        font-size: 11px;
        padding: 3px 10px;
    }

    .complaint-actions {
        flex-direction: column;
        width: 100%;
        gap: 6px;
    }

    .btn-view,
    .btn-delete,
    .btn-assign,
    .btn-complete {
        width: 100%;
        margin: 0;
        padding: 10px 16px;
        font-size: 13px;
        font-weight: 500;
    }

    .login-box {
        padding: 30px 20px;
    }

    .login-header .emblem {
        font-size: 48px;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-content.large-modal {
        max-width: 100%;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-header h2 {
        font-size: 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .upload-area {
        padding: 24px 12px;
    }

    .upload-icon {
        font-size: 36px;
    }

    .modal-footer {
        padding: 12px 16px;
        flex-direction: column;
    }

    .btn-cancel,
    .btn-submit {
        width: 100%;
        padding: 12px 20px;
        font-size: 15px;
    }

    .success-modal-content {
        padding: 30px 20px;
    }

    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 36px;
    }

    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .detail-label {
        min-width: auto;
        font-size: 12px;
    }
}
