/* 
  Responsive Stylesheet
  Created for Phoenix Ind
*/

/* General Repeater Fixes */
[data-repeater-item]:first-child [data-repeater-delete] {
    display: none !important;
}

/* Mobile Styles (up to 768px) */
@media (max-width: 767.98px) {
    .pc-container {
        padding: 10px;
    }

    /* Form Actions (Buttons at bottom) */
    .bom-form-actions .btn, .d-flex.flex-column.gap-2 .btn {
        width: 100%;
        margin-right: 0 !important;
        margin-bottom: 5px !important;
    }

    /* General Responsive Stack Table */
    .table-responsive-stack thead {
        display: none;
    }
    
    .table-responsive-stack tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #eef0f2;
        border-radius: 12px;
        padding: 12px;
        background: #fff;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    }
    
    .table-responsive-stack tbody td {
        display: flex;
        flex-direction: column;
        padding: 8px 0 !important;
        border: 0;
        text-align: left;
    }
    
    .table-responsive-stack tbody td:before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: #999;
        margin-bottom: 4px;
    }

    /* Form Controls in Stacked Table */
    .table-responsive-stack .form-control,
    .table-responsive-stack .ts-wrapper {
        width: 100% !important;
    }

    /* Action cell in stacked table */
    .table-responsive-stack td.text-center {
        width: 100% !important;
        display: block !important;
        margin-top: 5px;
    }
    
    .table-responsive-stack td.text-center button {
        width: 100% !important;
        margin-top: 5px;
    }

    /* Hide delete button for first row in repeaters */
    [data-repeater-item]:first-child [data-repeater-delete] {
        display: none !important;
    }

    /* BOM-Specific Overrides (Card Style) */
    .table-responsive-stack[id="bom-table"] tbody tr {
        position: relative;
        padding: 15px;
    }
    
    .table-responsive-stack[id="bom-table"] tbody td[data-label="Component"] {
        font-size: 1.05rem;
        margin-bottom: 8px;
        padding-right: 40px !important;
    }
    
    .table-responsive-stack[id="bom-table"] tbody td[data-label="Component"]:before {
        display: none;
    }

    .table-responsive-stack[id="bom-table"] tbody td[data-label="Quantity"] {
        flex-direction: row;
        font-size: 0.9rem;
        color: #6c757d;
    }
    
    .table-responsive-stack[id="bom-table"] tbody td[data-label="Quantity"]:before {
        content: "Qty: ";
        text-transform: none;
        font-size: inherit;
        margin-right: 5px;
        margin-bottom: 0;
    }

    .table-responsive-stack[id="bom-table"] tbody td[data-label="Action"] {
        position: absolute;
        top: 15px;
        right: 15px;
        width: auto;
    }
    
    .table-responsive-stack[id="bom-table"] tbody td[data-label="Action"]:before {
        display: none;
    }

    .table-responsive-stack .badge {
        box-shadow: none !important;
        border-radius: 8px !important;
    }
}

/* Tablet Styles (576px to 768px) */
@media (min-width: 576px) and (max-width: 767.98px) {
}

/* Medium Devices (768px to 992px) */
@media (min-width: 768px) and (max-width: 991.98px) {
}

/* Large Devices (992px to 1200px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
}

/* Extra Large Devices (1200px and up) */
@media (min-width: 1200px) {
}
