﻿.wrap,
.main-content-box,
.box-body {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.box-body {
    overflow: hidden;
}


/* =========================================================
           TITLE
           ========================================================= */

.title-bar {
    width: 100%;
    box-sizing: border-box;
}


/* =========================================================
           RESPONSIVE SEARCH FORM
           ========================================================= */

.form-grid {
    display: grid;
    /*
             * Desktop:
             * Label | Input | Label | Captcha | Input | Button
             */
    grid-template-columns: auto minmax(150px, 1fr) auto minmax(100px, auto) minmax(120px, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.form-label {
    margin: 0;
    white-space: nowrap;
}

.input-group {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

    .input-group input,
    .input-group .form-control {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

.captcha-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 100px;
    max-width: 150px;
    min-height: 38px;
    overflow: hidden;
    box-sizing: border-box;
}

    .captcha-box img {
        display: block;
        max-width: 100%;
        height: auto;
    }

.cap-input-grp {
    min-width: 120px;
}

.btn-green {
    white-space: nowrap;
}


/* =========================================================
           VALIDATION
           ========================================================= */

.P_inputerror {
    display: block;
    color: #d9534f;
    font-size: 12px;
    margin-top: 3px;
}


/* =========================================================
           GRIDVIEW RESPONSIVE WRAPPER
           ========================================================= */

.water-quality-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin-top: 15px;
    box-sizing: border-box;
}

    .water-quality-table-wrapper table {
        width: 100%;
        min-width: 700px;
        margin-bottom: 0;
    }

    .water-quality-table-wrapper th,
    .water-quality-table-wrapper td {
        vertical-align: middle;
        white-space: nowrap;
    }


/* =========================================================
           CHART / TREE
           ========================================================= */

.chart-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    width: 100%;
    box-sizing: border-box;
}

.node-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #1ba0e1;
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0, 114, 188, 0.12);
    z-index: 2;
    max-width: 100%;
    box-sizing: border-box;
}

.drop-icon {
    width: 22px;
    height: 22px;
    background: var(--blue, #0072bc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

    .drop-icon svg {
        width: 13px;
        height: 13px;
        fill: currentColor;
    }

.node-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--blue-dark, #0D3E70);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.line-v {
    width: 2px;
    height: 20px;
    background: #0072bc;
}


/* =========================================================
           TREE BRANCH LEVEL
           ========================================================= */

.branch-level3 {
    display: flex;
    justify-content: space-between;
    width: 100%;
    position: relative;
    margin-top: 20px;
    padding-top: 20px;
}

    .branch-level3::before {
        content: '';
        position: absolute;
        top: 0;
        left: 16%;
        right: 16%;
        height: 2px;
        background: #0072bc;
    }

    .branch-level3::after {
        content: '';
        position: absolute;
        top: -20px;
        left: 50%;
        width: 2px;
        height: 20px;
        background: #0072bc;
    }


/* =========================================================
           SUB BRANCH
           ========================================================= */

.sub-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    min-width: 0;
}

    .sub-branch::before {
        content: '';
        position: absolute;
        top: -20px;
        left: 50%;
        width: 2px;
        height: 20px;
        background: #0072bc;
    }


/* =========================================================
           SUB TREE
           ========================================================= */

.sub-tree-horizontal {
    display: flex;
    gap: 15px;
    position: relative;
    margin-top: 20px;
    padding-top: 15px;
}

    .sub-tree-horizontal::before {
        content: '';
        position: absolute;
        top: 0;
        left: 20%;
        right: 20%;
        height: 2px;
        background: #0072bc;
    }

    .sub-tree-horizontal::after {
        content: '';
        position: absolute;
        top: -15px;
        left: 50%;
        width: 2px;
        height: 15px;
        background: #0072bc;
    }


/* =========================================================
           SUB NODE
           ========================================================= */

.sub-node-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

    .sub-node-item::before {
        content: '';
        position: absolute;
        top: -15px;
        left: 50%;
        width: 2px;
        height: 15px;
        background: #0072bc;
    }


/* =========================================================
           TABLET - BELOW 992px
           ========================================================= */

@media (max-width: 992px) {

    .panel {
        padding-left: 10px;
        padding-right: 10px;
    }

    .form-grid {
        /*
                 * Two-column layout
                 */
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .form-label {
        white-space: normal;
    }

    .captcha-box {
        max-width: 100%;
        justify-content: flex-start;
    }
}


/* =========================================================
           MOBILE - BELOW 767px
           ========================================================= */

@media (max-width: 767px) {

    .panel {
        width: 100%;
        margin: 5px auto 10px;
        padding-left: 8px;
        padding-right: 8px;
    }


    /* Title */

    .title-bar {
        font-size: 16px;
        text-align: center;
        padding: 10px;
    }


    /* Body */

    .box-body {
        padding: 10px !important;
    }


    /* Search form */

    .form-grid {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 7px;
        width: 100%;
    }


    /* Labels */

    .form-label {
        display: block;
        width: 100%;
        margin-top: 5px;
        margin-bottom: 2px;
        font-size: 14px;
        white-space: normal;
    }


    /* Input */

    .input-group,
    .cap-input-grp {
        width: 100%;
        min-width: 0;
    }

        .input-group input,
        .input-group .form-control {
            width: 100%;
        }


    /* CAPTCHA */

    .captcha-box {
        display: flex;
        width: 100%;
        max-width: 100%;
        min-height: 40px;
        justify-content: flex-start;
        align-items: center;
    }

        .captcha-box img {
            max-width: 180px;
            height: auto;
        }


    /* Search button */

    .form-grid > div:last-child {
        width: 100%;
        margin-top: 5px;
    }

    .form-grid .btn-green,
    .form-grid input[type="submit"],
    .form-grid input[type="button"] {
        width: 100%;
        min-height: 40px;
    }


    /* Grid */

    .water-quality-table-wrapper {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        overflow-x: auto;
    }

        .water-quality-table-wrapper table {
            min-width: 700px;
            font-size: 12px;
        }

        .water-quality-table-wrapper th,
        .water-quality-table-wrapper td {
            padding: 7px 8px !important;
        }


    /* Tree */

    .branch-level3,
    .sub-tree-horizontal {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding-top: 0;
        margin-top: 10px;
    }

        .branch-level3::before,
        .branch-level3::after,
        .sub-tree-horizontal::before,
        .sub-tree-horizontal::after,
        .sub-branch::before,
        .sub-node-item::before {
            display: none;
        }

    .sub-branch {
        width: 100%;
    }

    .node-container {
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }

    .node-title {
        white-space: normal;
        text-align: center;
    }
}


/* =========================================================
           SMALL MOBILE - BELOW 400px
           ========================================================= */

@media (max-width: 400px) {

    .panel {
        padding-left: 5px;
        padding-right: 5px;
    }

    .box-body {
        padding: 7px !important;
    }

    .title-bar {
        font-size: 14px;
    }

    .form-label {
        font-size: 13px;
    }

    .water-quality-table-wrapper table {
        min-width: 650px;
        font-size: 11px;
    }
}
/* --- FEEDBACK FORM STYLES --- */
.feedback-container {
    padding: 20px;
    background-color: #ffffff;
}

.feedback-card {
    max-width: 520px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e1e8ef;
}

.feedback-header {
    background: var(--blue);
    color: #ffffff;
    padding: 14px 20px;
    font-size: 0.98rem;
    font-weight: 600;
}

.feedback-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

    .form-group label {
        display: block;
        font-size: 0.85rem;
        font-weight: 600;
        color: #333333;
        margin-bottom: 6px;
    }

        .form-group label span.req {
            color: #d9534f;
        }

        .form-group label span.hint {
            color: #d9534f;
            font-style: italic;
            font-weight: normal;
        }

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.88rem;
    border: 1px solid #cccccc;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

    .form-control:focus {
        border-color: #6a5acd;
        box-shadow: 0 0 5px rgba(106, 90, 205, 0.3);
    }

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Two columns for Name & Email */
.form-row {
    display: flex;
    gap: 15px;
}

    .form-row .form-group {
        flex: 1;
    }

/* Captcha styling */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-box {
    background-color: #f0f3f6;
    border: 1px solid #cbd5e1;
    padding: 6px 14px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 3px;
    color: #1e293b;
    user-select: none;
    text-decoration: line-through;
}

.captcha-input {
    max-width: 220px;
}

/* Buttons styling */
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-reset {
    background-color: #5a6268;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .btn-reset:hover {
        background-color: #484e53;
    }

.btn-send {
    background-color: #00bcd4;
    color: #ffffff;
    border: none;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .btn-send:hover {
        background-color: #00acc1;
    }

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .feedback-card {
        max-width: 100%;
    }
}