/* Site-wide mobile-friendly layout for Dogz on Deck */

/* --- Touch-friendly controls --- */
@media (max-width: 767px) {
    .form-control,
    select.form-control,
    .input-group .form-control {
        min-height: 44px;
        font-size: 16px;
    }

    .btn,
    .btn-sm {
        min-height: 44px;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .section-heading h5,
    .sub-header {
        font-size: 1.1rem;
        line-height: 1.35;
        word-break: break-word;
    }

    .dogz-disclaimer {
        font-size: 0.95rem;
        line-height: 1.5;
        color: #555;
        margin-top: 1.25rem;
    }
}

/* --- Status legend (running order, my dog, etc.) --- */
.status-legend,
.mydog-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.status-legend .label,
.mydog-legend .label {
    display: inline-block;
    font-size: 0.85rem;
    padding: 0.45em 0.75em;
    white-space: normal;
    line-height: 1.3;
}

/* --- Splash list on home / index --- */
.splash-nav {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.splash-nav li {
    margin-bottom: 0.5rem;
}

.splash-nav a {
    display: block;
    padding: 0.85rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    color: #333;
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.35;
    word-break: break-word;
}

.splash-nav a:hover,
.splash-nav a:focus {
    background: #eee;
    text-decoration: none;
}

/* --- Card-style tables on small screens --- */
@media (max-width: 767px) {
    .table-cards {
        border: 0;
    }

    .table-cards thead {
        display: none;
    }

    .table-cards tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid #ddd;
        border-radius: 4px;
        overflow: hidden;
        background: #fff;
    }

    .table-cards tbody tr.default {
        opacity: 0.75;
    }

    .table-cards tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.6rem 0.85rem;
        border: 0;
        border-bottom: 1px solid #eee;
        text-align: right;
        word-break: break-word;
    }

    .table-cards tbody td:last-child {
        border-bottom: 0;
    }

    .table-cards tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        text-align: left;
        flex: 0 0 42%;
        color: #333;
    }

    .table-cards tbody td[data-label="Running Order"],
    .table-cards tbody td[data-label="#"] {
        font-size: 1.15rem;
        font-weight: 700;
    }

    .table-responsive {
        border: 0;
        margin-bottom: 0;
        -webkit-overflow-scrolling: touch;
    }
}

/* --- Dog block header (my dog, wasatch) --- */
.dog-block {
    margin-bottom: 2rem;
}

.dog-block-header {
    padding: 0.75rem 1rem;
    margin-bottom: 0;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
    font-size: 1rem;
    line-height: 1.4;
    word-break: break-word;
}

@media (max-width: 767px) {
    .dog-block-header {
        border-radius: 4px;
        border-bottom: 1px solid #ddd;
        margin-bottom: 0.75rem;
    }
}

/* --- Public running order page --- */
.ro-public-page .ro-public-title {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    line-height: 1.35;
    word-break: break-word;
}

@media (max-width: 767px) {
    .ro-public-order,
    .ro-public-order tbody {
        display: block;
    }

    .ro-public-order {
        border: 0;
    }

    .ro-public-order thead {
        display: none;
    }

    .ro-public-order tbody tr {
        display: flex;
        flex-wrap: nowrap;
        align-items: baseline;
        gap: 0;
        padding: 0.75rem 1rem;
        margin-bottom: 0.5rem;
        border: 1px solid #ddd;
        border-radius: 6px;
        background: #fff;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ro-public-order tbody tr.info {
        background: #d9edf7;
        border-color: #bce8f1;
    }

    .ro-public-order tbody tr.success {
        background: #dff0d8;
        border-color: #d6e9c6;
    }

    .ro-public-order tbody tr.danger {
        background: #f2dede;
        border-color: #ebccd1;
    }

    .ro-public-order tbody tr.warning {
        background: #fcf8e3;
        border-color: #faebcc;
    }

    .ro-public-order tbody tr.complete {
        opacity: 0.7;
    }

    .ro-public-order tbody td {
        display: inline;
        padding: 0;
        border: 0;
        text-align: left;
        white-space: nowrap;
    }

    .ro-public-order tbody td::before {
        content: none;
        display: none;
    }

    .ro-public-order tbody td[data-label="Handler"]::before,
    .ro-public-order tbody td[data-label="Breed"]::before {
        content: " · ";
        display: inline;
        font-weight: 400;
        color: #666;
    }

    .ro-public-order tbody td[data-label="Dog"] {
        font-size: 1.1rem;
        font-weight: 700;
        line-height: 1.25;
    }

    .ro-public-order tbody td[data-label="Handler"],
    .ro-public-order tbody td[data-label="Breed"] {
        font-size: 0.95rem;
        line-height: 1.35;
        color: #444;
    }
}

/* --- Footer --- */
footer .img-responsive {
    max-width: 120px;
    width: 40%;
    height: auto;
}

@media (max-width: 767px) {
    footer .credits {
        padding: 1rem 0.5rem;
        font-size: 0.9rem;
    }
}

/* --- Kiosk displays --- */
@media (max-width: 767px) {
    body.kiosk {
        padding: 0.75rem;
    }

    .kiosk-header h1 {
        font-size: 1.5rem;
    }

    .kiosk-header h2 {
        font-size: 1.15rem;
    }

    .kiosk-table {
        font-size: 1.05rem;
    }

    .kiosk-pools-table td {
        font-size: 1.15rem;
    }

    .kiosk-next,
    .kiosk-empty {
        font-size: 1rem;
    }

    .kiosk-legend .label {
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }

    .kiosk-footer img {
        height: 72px;
        width: auto;
    }
}

/* --- Admin: login --- */
.dogz-login-form {
    width: 450px;
    max-width: 100%;
}

@media (max-width: 767px) {
    .dogz-login-section .container {
        min-height: auto !important;
        padding-top: 5rem;
        padding-bottom: 2rem;
    }

    .dogz-login-form {
        width: 100%;
    }
}

/* --- Admin: toolbars & forms --- */
@media (max-width: 767px) {
    .admin-toolbar {
        display: flex;
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }

    .admin-toolbar .btn {
        width: 100%;
    }

    .form-inline.admin-filter-form {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .form-inline.admin-filter-form label,
    .form-inline.admin-filter-form select,
    .form-inline.admin-filter-form .btn,
    .form-inline.admin-filter-form a.btn {
        width: 100%;
        margin-left: 0 !important;
    }

    .admin-bulk-actions .btn {
        display: block;
        width: 100%;
        margin: 0 0 0.5rem !important;
    }

    .admin-bulk-actions .text-muted {
        display: block;
        margin: 0.5rem 0 0 !important;
    }

    .center-btns .btn,
    .center-btns button {
        display: block;
        width: 100%;
        margin-bottom: 0.75rem;
        min-height: 44px;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    .admin-data-table .form-control {
        min-width: 0;
        font-size: 16px;
    }

    .admin-data-table td,
    .admin-data-table th {
        white-space: nowrap;
    }
}

/* --- Admin: pool drag-and-drop layout --- */
@media (max-width: 991px) {
    .pool-admin-layout > table,
    .pool-admin-layout > table > tbody,
    .pool-admin-layout > table > tbody > tr,
    .pool-admin-layout > table > tbody > tr > td {
        display: block;
        width: 100%;
    }

    .pool-admin-layout > table > tbody > tr > td[width] {
        display: none;
    }

    .pool-admin-layout .pool {
        margin-bottom: 1.25rem;
        min-height: 3rem;
        padding: 0.5rem;
        border: 1px solid #ccc;
        border-radius: 4px;
        background: #fafafa;
    }

    .pool-admin-layout .pool .title {
        margin: 0 0 0.5rem;
        font-size: 1rem;
        font-weight: 700;
    }

    .pool-admin-layout .splash {
        padding: 0.65rem 0.75rem;
        margin-bottom: 0.35rem;
        border: 1px solid #ddd;
        border-radius: 4px;
        background: #fff;
        font-size: 0.95rem;
        line-height: 1.35;
        cursor: grab;
        touch-action: none;
    }
}

/* --- Admin: splash nav collapse buttons --- */
@media (max-width: 767px) {
    section .btn[data-toggle="collapse"] {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
        min-height: 44px;
        white-space: normal;
        text-align: left;
    }
}
