/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

 @import "bulma.min.css";

/* Add to your existing CSS */
.status-badge {
    display: inline-block;
    padding: 0.25em 0.5em;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 600;
}
.status-active {
    background-color: #e5f9e5;
    color: #1e7e1e;
}
.status-inactive {
    background-color: #f9e5e5;
    color: #7e1e1e;
}
.status-pending {
    background-color: #f9f5e5;
    color: #7e6e1e;
}

.product-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.product-thumbnail {
    width: 70px;
}

/* For the empty state */
.woocommerce-no-items {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Tab navigation styles */
.tabs-wrapper {
    margin-bottom: 2rem;
}

.tabs ul {
    border-bottom-color: #dbdbdb;
}

.tabs li.is-active a {
    border-bottom-color: #3273dc;
    color: #3273dc;
}

.tabs a {
    padding: 0.5em 1em;
    font-weight: 500;
}

/* Dashboard styles */
.dashboard-stats {
    margin-top: 2rem;
}

.dashboard-stats .card {
    height: 100%;
}

.dashboard-stats .subtitle.is-1 {
    text-align: center;
    font-size: 3rem;
    margin-top: 1rem;
}

.recent-activity {
    margin-top: 3rem;
}

.woocommerce .button.is-text {
    background: none !important;
    border: none !important;
    color: #555 !important;
    letter-spacing: 0 !important;
    text-transform: capitalize !important;
}
.woocommerce a.button, .woocommerce .button {
    font-size: 14px !important;
    padding: 10px 15px !important;
}
.is-flex.is-2 {
    gap: 1rem;
}
.product-info {
    display: flex;
    flex-direction: column;
}
.product-name {
    font-weight: bold;
    margin-bottom: 5px;
}
.product-price {
    color: #666;
    font-size: 0.8em;
}

/* Editable quantity input */
.editable-quantity {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.85em;
}

.editable-quantity label {
    color: #555;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.quantity-input {
    width: 60px !important;
    padding: 3px 6px !important;
    font-size: 0.9em !important;
    border: 1px solid #ccc !important;
    border-radius: 3px !important;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.quantity-input:focus {
    border-color: #3273dc !important;
    box-shadow: 0 0 0 2px rgba(50, 115, 220, 0.15) !important;
    outline: none;
}

.quantity-input.saving {
    border-color: #f0ad4e !important;
    background-color: #fffdf5;
}

.quantity-input.saved {
    border-color: #5cb85c !important;
    background-color: #f0fff0;
}

.quantity-input.save-error {
    border-color: #d9534f !important;
    background-color: #fff5f5;
}
.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.add-all-actions {
    text-align: right;
    margin-bottom: 2rem;
}
#add-to-cart-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 300px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.add-all-cell .add-room-to-cart {
    margin: 0 0 0 auto !important;
}

.subtotal-row {
    background-color: #f9f9f9;
    border-top: 2px solid #e0e0e0;
}

.subtotal-label {
    text-align: right;
    padding: 12px 15px !important;
}

.subtotal-value {
    font-size: 1.1em;
    padding: 12px 15px !important;
}

.variable-pricing-note {
    display: block;
    font-size: 0.8em;
    font-weight: normal;
    color: #777;
    margin-top: 3px;
}

.add-all-cell {
    text-align: right;
}

.private-product-label {
    display: inline-block;
    background-color: #f8e8ff;
    color: #6a1b9a;
    font-size: 0.7em;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
    font-weight: 600;
}

.out-of-stock-label {
    display: inline-block;
    background-color: #fdecea;
    color: #b71c1c;
    font-size: 0.7em;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
    font-weight: 600;
}

.out-of-stock-row {
    opacity: 0.7;
}

.out-of-stock-row .product-thumbnail img {
    filter: grayscale(40%);
}

/* Make private products stand out in the search results */
.product-result[data-product*="\"is_private\":true"] {
    background-color: #faf5ff;
    border-left: 3px solid #9c27b0;
}

/* Variable product styles */
.variable-product {
    border-left: 3px solid #3273dc;
    background-color: #f5f9ff;
}

/* Variant selection modal */
.modal {
    display: none;
}

.modal.is-active {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-card {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background-color: white;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #dbdbdb;
}

.modal-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.modal-card-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-card-foot {
    display: flex;
    justify-content: flex-end;
    padding: 15px 20px;
    background-color: #f5f5f5;
    border-top: 1px solid #dbdbdb;
}

.variant-list {
    max-height: 400px;
    overflow-y: auto;
}

.variant-item {
    display: flex;
    padding: 10px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.variant-item:hover {
    background-color: #f9f9f9;
}

.variant-image {
    width: 60px;
    height: 60px;
    margin-right: 15px;
}

.variant-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
}

.variant-info {
    flex-grow: 1;
}

.variant-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.variant-price {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.variant-attributes {
    font-size: 0.8em;
    color: #777;
}

.variant-separator {
    margin: 15px 0;
    border: 0;
    height: 1px;
    background-color: #e0e0e0;
}

.delete {
    background-color: rgba(10, 10, 10, 0.2);
    border: none;
    border-radius: 290486px;
    cursor: pointer;
    display: inline-block;
    flex-grow: 0;
    flex-shrink: 0;
    font-size: 0;
    height: 20px;
    max-height: 20px;
    max-width: 20px;
    min-height: 20px;
    min-width: 20px;
    outline: none;
    position: relative;
    vertical-align: top;
    width: 20px;
}

.delete::before, .delete::after {
    background-color: white;
    content: "";
    display: block;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translateX(-50%) translateY(-50%) rotate(45deg);
    transform-origin: center center;
}

.delete::before {
    height: 2px;
    width: 50%;
}

.delete::after {
    height: 50%;
    width: 2px;
}

.delete:hover, .delete:focus {
    background-color: rgba(10, 10, 10, 0.3);
}

/* Product search results styling */
.product-search-results {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 400px;
    overflow-y: auto;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-radius: 0 0 4px 4px;
}

.product-result {
    display: flex;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.product-result:last-child {
    border-bottom: none;
}

.product-result:hover {
    background-color: #f9f9f9;
}

.product-result-image {
    width: 50px;
    height: 50px;
    min-width: 50px;
    margin-right: 15px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
    border: 1px solid #eee;
}

.product-result-info {
    flex-grow: 1;
}

.product-result-name {
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.product-result-price {
    color: #666;
    font-size: 0.85em;
}

/* Selected product card styling */
.selected-product-card {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.selected-product-header {
    margin-bottom: 15px;
}

.selected-product-header h4 {
    margin: 0;
    font-size: 1.1em;
    color: #333;
}

.selected-product-content {
    display: flex;
    margin-bottom: 20px;
}

.selected-product-image {
    width: 80px;
    margin-right: 15px;
}

.selected-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.selected-product-details {
    flex-grow: 1;
}

.selected-product-name {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.selected-product-price {
    color: #666;
}

/* Trash button styling */
.button-remove-recommendation {
    background-color: #e7610d !important;
    color: white !important;
    border: none !important;
    padding: 0.5em !important;
    height: 2.5em !important;
    width: 2.5em !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.2s !important;
}

.button-remove-recommendation:hover {
    background-color: #d25600 !important;
}

.button-remove-recommendation:before {
    content: "\f2ed"; /* Font Awesome trash icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 1em;
}

/* Hide text inside button */
.button-remove-recommendation span {
    display: none;
}

/* Room delete button styling - similar to remove recommendation button */
.button-remove-room {
    background-color: #e7610d !important;
    color: white !important;
    border: none !important;
    padding: 0.5em !important;
    height: 2.5em !important;
    width: 2.5em !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.2s !important;
}

.button-remove-room:hover {
    background-color: #d25600 !important;
}

.button-remove-room:before {
    content: "\f2ed"; /* Font Awesome trash icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 1em;
}

/* Hide text inside button */
.button-remove-room span {
    display: none;
}

/* Room name capitalization */
.room-name,
h3.title.is-capitalized,
.room-header,
option[value^="room-"] {
    text-transform: capitalize !important;
}

/* For select dropdowns */
select#recommendation_room option {
    text-transform: capitalize;
}

/* For room tables */
.rooms table td:first-child {
    text-transform: capitalize;
}

/* Drag and drop styles */
.recommendation-row {
    cursor: grab;
    transition: background-color 0.2s ease;
}

.recommendation-row:active {
    cursor: grabbing;
}

.recommendation-row .drag-handle {
    color: #999;
    margin-right: 10px;
    cursor: grab;
}

.recommendation-row .drag-handle:active {
    cursor: grabbing;
}

.recommendation-row .drag-handle i {
    font-size: 1.2em;
}

/* jQuery UI sortable styles */
.ui-state-highlight {
    height: 3em;
    line-height: 1.2em;
    background-color: #f5f9ff !important;
    border: 2px dashed #3273dc !important;
    box-shadow: none !important;
}

.ui-sortable-helper {
    display: table;
    background-color: #f5f5f5 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
    opacity: 0.9 !important;
}

/* Cross-room drag-and-drop styles */
.recommendations-table.drop-target-available {
    outline: 2px dashed #b0c4de;
    outline-offset: 4px;
    border-radius: 4px;
    transition: outline-color 0.2s ease, box-shadow 0.2s ease;
}

.recommendations-table.drop-target-hover {
    outline-color: #3273dc;
    box-shadow: 0 0 12px rgba(50, 115, 220, 0.2);
    background-color: rgba(50, 115, 220, 0.02);
}

.loading-indicator {
    padding: 8px 16px;
    background-color: #f0f4ff;
    color: #3273dc;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 0.9em;
    font-weight: 500;
    animation: pulse-loading 1.5s ease-in-out infinite;
}

@keyframes pulse-loading {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Package preview */
.package-preview {
    margin: 15px 0;
}

.package-preview-table {
    font-size: 0.9em;
}

.package-preview-table img {
    flex-shrink: 0;
}

.apply-package .card-content .field:last-child {
    margin-top: 10px;
}

/* ========================================
   Mobile Responsive Styles
   ======================================== */

@media screen and (max-width: 768px) {

    /* WooCommerce My Account layout: full width on mobile */
    .woocommerce-account .woocommerce-MyAccount-content {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation {
        width: 100% !important;
        float: none !important;
        margin-bottom: 1.5rem;
    }

    /* My Account page title */
    .woocommerce-account h1,
    .woocommerce-MyAccount-content > h1 {
        font-size: 32px !important;
    }

    /* Top-level page cards */
    .woocommerce-account-content .card {
        margin-left: -10px;
        margin-right: -10px;
        border-radius: 0;
        box-shadow: none;
        border-left: none;
        border-right: none;
    }

    .woocommerce-account-content .card .card-content {
        padding: 12px;
    }

    .woocommerce-account-content .card .card-header-title {
        font-size: 0.95rem;
        padding: 10px 12px;
    }

    /* Rooms table within cards */
    .rooms .woocommerce-table th,
    .rooms .woocommerce-table td {
        padding: 8px 10px;
        font-size: 0.9em;
    }

    .rooms .buttons.are-small {
        flex-wrap: nowrap;
        gap: 4px;
    }

    /* Inputs and selects full width on mobile */
    .woocommerce-account-content .input,
    .woocommerce-account-content .textarea,
    .woocommerce-account-content select.input {
        font-size: 16px; /* prevent iOS zoom */
    }

    /* Recommendation tables: card layout on mobile */
    .recommendations-table {
        border: none !important;
        box-shadow: none !important;
    }

    .recommendations-table thead {
        display: none;
    }

    .recommendations-table tbody.sortable-recommendations {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* Each recommendation row becomes a card */
    .recommendations-table .recommendation-row {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto auto;
        gap: 0 12px;
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        padding: 12px;
        background: #fff;
    }

    .recommendations-table .recommendation-row.out-of-stock-row {
        background: #fafafa;
    }

    .recommendations-table .recommendation-row > td {
        display: block;
        border: none;
        padding: 0;
    }

    /* Drag handle: sits at top-left of the image column */
    .recommendations-table .recommendation-row .drag-handle {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
        padding-right: 6px;
    }

    /* Thumbnail */
    .recommendations-table .recommendation-row .product-thumbnail {
        grid-column: 1;
        grid-row: 1 / 3;
        width: 60px;
        align-self: start;
    }

    /* When drag handle is present, thumbnail shifts */
    .recommendations-table .recommendation-row .drag-handle ~ .product-thumbnail {
        grid-row: 1 / 3;
        padding-left: 0;
    }

    .recommendations-table .recommendation-row .product-thumbnail img {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 6px;
    }

    /* Product info column (name, price, qty) */
    .recommendations-table .recommendation-row .rec-col-product {
        grid-column: 2;
        grid-row: 1;
    }

    .recommendations-table .recommendation-row .product-name {
        font-size: 0.95em;
        line-height: 1.3;
        margin-bottom: 2px;
    }

    .recommendations-table .recommendation-row .product-name a {
        word-break: break-word;
    }

    .recommendations-table .recommendation-row .private-product-label,
    .recommendations-table .recommendation-row .out-of-stock-label {
        display: inline-block;
        margin-left: 0;
        margin-top: 2px;
    }

    /* Date column — hidden, shown as small text via data-label */
    .recommendations-table .recommendation-row .rec-col-date {
        grid-column: 2;
        grid-row: 2;
        font-size: 0.78em;
        color: #999;
        margin-top: 2px;
    }

    /* Notes column — full width below */
    .recommendations-table .recommendation-row .rec-col-notes {
        grid-column: 1 / -1;
        margin-top: 8px;
        font-size: 0.85em;
        color: #555;
        padding: 6px 8px;
        background: #f9f9f9;
        border-radius: 4px;
    }

    .recommendations-table .recommendation-row .rec-col-notes:empty {
        display: none;
    }

    /* Status column — inline */
    .recommendations-table .recommendation-row .rec-col-status {
        grid-column: 1 / -1;
        margin-top: 6px;
    }

    /* Actions column — full width, right-aligned */
    .recommendations-table .recommendation-row .rec-col-actions {
        grid-column: 1 / -1;
        margin-top: 8px;
        display: flex;
        justify-content: flex-end;
        gap: 8px;
    }

    .recommendations-table .recommendation-row .rec-col-actions.is-flex {
        padding: 0;
    }

    /* Subtotal row on mobile */
    .recommendations-table .subtotal-row {
        display: flex;
        flex-wrap: wrap;
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        padding: 12px;
        background: #f9f9f9;
        align-items: center;
    }

    .recommendations-table .subtotal-row td {
        display: block;
        border: none;
    }

    .recommendations-table .subtotal-row .subtotal-label {
        text-align: left;
        padding: 0 !important;
        flex: 1;
    }

    .recommendations-table .subtotal-row .subtotal-value {
        padding: 0 !important;
        text-align: right;
    }

    .recommendations-table .subtotal-row .add-all-cell {
        width: 100%;
        text-align: center;
        padding-top: 10px !important;
    }

    .recommendations-table .subtotal-row .add-all-cell .button {
        width: 100%;
    }

    /* No recommendations empty state */
    .recommendations-table .woocommerce-no-items {
        text-align: center;
        padding: 16px 12px;
        font-size: 0.9em;
    }

    /* Modal adjustments */
    .modal-card {
        width: 95%;
        max-height: 90vh;
    }

    .modal-card-head,
    .modal-card-foot {
        padding: 10px 15px;
    }

    .modal-card-body {
        padding: 15px;
    }

    .modal-card-foot .buttons {
        flex-wrap: wrap;
        width: 100%;
        gap: 8px;
    }

    .modal-card-foot .buttons .button {
        flex: 1 1 auto;
    }

    /* Package preview table on mobile */
    .package-preview-table thead {
        display: none;
    }

    .package-preview-table tr {
        display: block;
        border: 1px solid #eee;
        border-radius: 6px;
        padding: 10px;
        margin-bottom: 8px;
        background: #fafafa;
    }

    .package-preview-table td {
        display: block;
        padding: 2px 0;
        border: none;
    }

    /* Section titles */
    .existing-recommendations .title.is-2 {
        font-size: 1.3rem;
    }

    /* Product search results */
    .product-search-results {
        max-height: 250px;
    }

    .product-result {
        padding: 10px;
    }

    .product-result-image {
        width: 40px;
        height: 40px;
        min-width: 40px;
        margin-right: 10px;
    }

    /* Add-to-cart status toast */
    #add-to-cart-status {
        left: 10px;
        right: 10px;
        max-width: none;
        bottom: 10px;
    }

    /* Cross-room drag-drop on mobile */
    .recommendations-table.drop-target-available {
        outline-offset: 2px;
    }

    /* Editable quantity on mobile */
    .editable-quantity {
        margin-top: 6px;
    }

    .quantity-input {
        width: 50px !important;
    }

    /* Selected product card in add recommendation */
    .selected-product-content {
        flex-direction: column;
    }

    .selected-product-image {
        width: 60px;
        margin-bottom: 10px;
    }

    /* Tabs on mobile */
    .team-members-tabs .tabs ul {
        flex-direction: column;
    }

    .team-members-tabs .tabs li {
        margin-bottom: 0;
    }

    .team-members-tabs .tabs a {
        justify-content: flex-start;
        padding: 8px 12px;
    }
}

@media screen and (max-width: 480px) {
    .recommendations-table .recommendation-row {
        padding: 10px;
    }

    .recommendations-table .recommendation-row .product-thumbnail {
        width: 50px;
    }

    .recommendations-table .recommendation-row .product-thumbnail img {
        width: 50px;
        height: 50px;
    }

    .recommendations-table .recommendation-row .product-name {
        font-size: 0.88em;
    }

    .woocommerce-account-content h2 {
        font-size: 1.3rem;
    }

    .woocommerce a.button, .woocommerce .button {
        font-size: 13px !important;
        padding: 8px 12px !important;
    }
}