/* =========================================
   MULTIPLE ITEM LAYOUT ONLY
   (No conflicts with index.css)
   ========================================= */

/* Add New Row Button Container */
.add-action-area {
    display: flex;
    justify-content: flex-end;
    margin: 20px 0;
    padding: 0 10px;
}

/* Add New Item Button - Premium style with content-fit width */
.add-action-area .btn-primary {
    width: auto;
    max-width: none;
    padding: 12px 24px;
    font-size: 0.95rem;
}

/* Mobile: Keep button on right side, not full width */
@media (max-width: 768px) {
    .add-action-area .btn-primary {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .add-action-area {
        padding: 0 5px;
    }
    
    .add-action-area .btn-primary {
        padding: 9px 18px;
        font-size: 0.85rem;
    }
}

/* Add New Row Button - Uses Premium Button from button-loading.css
   Removed custom styles - will use .btn-primary .btn-ripple classes */

/* Row Separator & Animation */
.item-row-wrapper {
    border-bottom: 2px dashed #ddd;
    margin-bottom: 25px;
    padding-bottom: 15px;
    animation: fadeIn 0.4s ease;
    position: relative;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Row Header - Fixed Layout */
.item-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 10px;
    gap: 12px;
    flex-wrap: nowrap;
}

.item-badge {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    color: #856404;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: "Rubik", sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(133, 100, 4, 0.1);
}

/* Remove Button - Rectangular Pill Design - FORCE OVERRIDE */
button.remove-row-btn {
    /* Size - Auto width for text */
    width: auto !important;
    height: 36px !important; /* Slightly taller */
    min-width: 0 !important; 
    max-width: none !important;
    padding: 0 16px !important;
    margin: 0 !important;
    gap: 8px !important;
    
    /* Style - Forced */
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%) !important;
    color: #dc3545 !important;
    border: 1px solid rgba(220, 53, 69, 0.2) !important;
    border-radius: 8px !important; /* Rounded corners, NOT circle */
    
    /* Layout */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    
    /* Effects */
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    box-shadow: none !important;
    
    /* Text Font */
    font-family: "Rubik", sans-serif !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.5px !important;
    transform: none;
}

button.remove-row-btn span {
    display: inline-block !important;
}

button.remove-row-btn:hover {
    background: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2) !important;
}

button.remove-row-btn:active {
    transform: translateY(0) !important;
    box-shadow: none !important;
}

button.remove-row-btn i {
    font-size: 0.9rem !important;
    margin: 0 !important;
    padding: 0 !important;
    color: inherit !important;
    transition: none !important;
}

/* =========================================
   FIX: Lock Icon Styling (EXACT MINIMAL MATCH with New Order)
   ========================================= */
.lock-toggle-wrapper {
    position: absolute !important;
    bottom: 12px !important;
    right: 12px !important;
    z-index: 20 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #9ca3af;
    transition: all 0.3s ease;
    padding: 5px;
}

.lock-toggle-wrapper:hover {
    color: #4b5563;
    transform: scale(1.1);
}

.lock-toggle-wrapper i {
    font-size: 0.9rem;
}

/* =========================================
   MOBILE RESPONSIVE ADJUSTMENTS
   ========================================= */
@media (max-width: 768px) {
    .item-badge {
        font-size: 0.75rem;
        padding: 5px 12px;
    }
    
    button.remove-row-btn {
        height: 32px !important;
        padding: 0 12px !important;
        font-size: 0.8rem !important;
    }

    button.remove-row-btn span {
        display: inline-block !important; /* Keep text visible on tablet */
    }

    /* Force 2-column layout for tablets */
    #items-container .item-row-wrapper .fields {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
    }
}

/* Increased breakpoint to 600px to cover large phones */
@media (max-width: 600px) {
    /* --- FIX: Force Layout Reset (User reported nav bar issue) --- */
    .sidebar {
        display: none !important;
        width: 0 !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 10px !important; /* Prevent padding overflow */
    }

    .container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 10px !important;
        box-shadow: none !important;
    }

    .topbar {
        flex-wrap: wrap !important; /* Allow wrapping */
        margin-bottom: 10px !important;
    }

    .item-row-header {
        gap: 10px;
        padding: 0 5px;
        margin-bottom: 12px;
    }
    
    .item-badge {
        font-size: 0.72rem;
        padding: 5px 10px;
        border-radius: 8px;
    }
    
    /* Mobile: Small compact button with text */
    button.remove-row-btn {
        height: 30px !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 0 10px !important;
        font-size: 0.75rem !important;
        border-radius: 6px !important;
    }
    
    button.remove-row-btn i {
        font-size: 0.8rem !important;
    }

    /* =========================================
       SMART GRID FOR MOBILE (Overrides repeat-mobile-responsive.css)
       Using ID specificity (#items-container) to strictly win
       ========================================= */
    #items-container .item-row-wrapper .fields {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important; /* EXACT match mine.css */
        gap: 0.8rem 0.4rem !important; /* EXACT match mine.css */
        margin-top: 1rem !important;
        padding: 0 !important;
    }

    /* Fix input height and padding for mobile */
    #items-container .item-row-wrapper .fields .input-field input,
    #items-container .item-row-wrapper .fields .input-field select {
        height: 42px !important;
        padding: 10px 12px !important;
        font-size: 0.9rem !important;
    }

    /* Fix label positioning for new height */
    #items-container .item-row-wrapper .fields .input-field label {
        font-size: 0.8rem !important;
    }
}
