/* FIXES for Warranty System v3 */

/* Button Block (Full Width) */
.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Search Box - Full Width Input */
.search-box form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box input[type="text"] {
    flex: 1;
    min-width: 250px;
}

/* Table Fixes - Prevent Horizontal Scroll */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.table-wrapper > div {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Desktop View - Show tables */
.desktop-view {
    display: block;
}

.mobile-view {
    display: none;
}

/* Make table responsive without scroll */
@media screen and (max-width: 1400px) {
    table {
        font-size: 14px;
    }
    
    table th,
    table td {
        padding: 10px;
    }
}

@media screen and (max-width: 1200px) {
    table {
        font-size: 13px;
    }
    
    table th,
    table td {
        padding: 8px;
    }
}

/* Mobile - Hide tables, show cards */
@media screen and (max-width: 768px) {
    .desktop-view {
        display: none !important;
    }
    
    .mobile-view {
        display: block !important;
    }
    
    .search-box input[type="text"] {
        min-width: 100%;
    }
}

/* Product Row Styling */
.product-row {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #007FB0;
    position: relative;
}

.product-row-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #007FB0;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.product-row .form-row {
    margin-left: 45px;
}

.btn-remove-row {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    position: absolute;
    top: 10px;
    right: 10px;
}

.btn-remove-row:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

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

.btn-save {
    background: #8DC63F;
    color: white;
}

.btn-save:hover {
    background: #7ab32e;
}

.btn-add {
    background: #007FB0;
    color: white;
    margin-top: 15px;
}

.btn-add:hover {
    background: #006690;
}

/* Required field marker */
.required {
    color: #dc3545;
    font-weight: bold;
}

/* Form Section */
.form-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.form-section h3 {
    color: #007FB0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h3 i {
    color: #8DC63F;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007FB0;
    box-shadow: 0 0 0 3px rgba(0, 127, 176, 0.1);
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .product-row .form-row {
        margin-left: 0;
        margin-top: 40px;
    }
}
